From 1393472d716785bf52017071886d3816c820356d Mon Sep 17 00:00:00 2001 From: JWJUN233233 <1306334428@qq.com> Date: Sat, 2 Sep 2023 21:08:40 +0800 Subject: [PATCH] =?UTF-8?q?CI=E8=87=AA=E5=8A=A8=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CI-Build.yml | 43 ++++++++++++++++++++++++++++++++++ .github/workflows/CI-Check.yml | 27 +++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/CI-Build.yml create mode 100644 .github/workflows/CI-Check.yml diff --git a/.github/workflows/CI-Build.yml b/.github/workflows/CI-Build.yml new file mode 100644 index 0000000..2dc4b95 --- /dev/null +++ b/.github/workflows/CI-Build.yml @@ -0,0 +1,43 @@ +name: CI-Build +on: + workflow_dispatch: + push: + branches: [ "**" ] + +env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + compile-flags: "-c Release" +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Test + run: dotnet test MinecraftLaunch.csproj + test_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Test + run: dotnet build MinecraftLaunch.csproj + build: + runs-on: ubuntu-latest + needs: [test, test_build] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build + run: dotnet build MinecraftLaunch.csproj ${{ env.compile-flags }} + - name: Publish + uses: brandedoutcast/publish-nuget@v2.5.2 + with: + PROJECT_FILE_PATH: MinecraftLaunch.csproj + NUGET_KEY: ${{secrets.NUGET_API_KEY}} \ No newline at end of file diff --git a/.github/workflows/CI-Check.yml b/.github/workflows/CI-Check.yml new file mode 100644 index 0000000..93d51e1 --- /dev/null +++ b/.github/workflows/CI-Check.yml @@ -0,0 +1,27 @@ +name: CI-Check +on: + workflow_dispatch: + push: + branches: [ "**" ] + pull_request: + types: + - opened +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Test + run: dotnet test MinecraftLaunch.csproj + test_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Test + run: dotnet build MinecraftLaunch.csproj