From c2d155e6a00ded3788051296fc8b8caf7d226a2f Mon Sep 17 00:00:00 2001 From: MouriNaruto Date: Mon, 12 Feb 2024 18:20:42 +0800 Subject: [PATCH] Create GitHub Action. --- .github/workflows/Publish.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/Publish.yml diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml new file mode 100644 index 0000000..0d5044d --- /dev/null +++ b/.github/workflows/Publish.yml @@ -0,0 +1,25 @@ +name: Publish + +on: [push] + +jobs: + build: + runs-on: windows-latest + env: + POWERSHELL_TELEMETRY_OPTOUT: 1 + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - uses: microsoft/setup-msbuild@v2 + - name: Clear local NuGet cache (workaround for failed restores on windows-latest) + run: dotnet nuget locals all --clear + - name: Build + run: msbuild BuildAllTargets.proj + - name: Publish to NuGet + if: contains(github.ref, 'tags/') + working-directory: ${{env.GITHUB_WORKSPACE}} + shell: cmd + run: | + :: 把生成的nuget包发布到nuget中 + nuget push Output\MINT.nupkg -ApiKey ${{ secrets.NUGET_TOKEN }} -Source https://api.nuget.org/v3/index.json