diff --git a/.github/workflows/build-master.yaml b/.github/workflows/build-master.yaml index c97bda0..e31a1cd 100644 --- a/.github/workflows/build-master.yaml +++ b/.github/workflows/build-master.yaml @@ -20,7 +20,7 @@ jobs: - uses: Cysharp/Actions/.github/actions/setup-dotnet@main - run: dotnet build -c Release -p:DefineConstants=RUNNING_IN_CI - run: dotnet test -c Release --no-build - - run: dotnet pack -c Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o artifacts + - run: dotnet pack -c Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o artifacts - uses: Cysharp/Actions/.github/actions/upload-artifact@main with: name: nuget diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 6d58c4c..95090e4 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -16,6 +16,7 @@ jobs: build-dotnet: permissions: contents: read + id-token: write # required for NuGet Trusted Publish runs-on: ubuntu-24.04 timeout-minutes: 5 steps: @@ -29,6 +30,20 @@ jobs: name: nuget path: ./publish retention-days: 1 + # push nuget + - name: NuGet login (OIDC) + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + id: login + with: + user: ${{ secrets.NUGET_USER }} + - run: dotnet nuget push "./publish/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}" + if: ${{ !inputs.dry-run }} + env: + NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} + - run: dotnet nuget push "./publish/*.snupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}" + if: ${{ !inputs.dry-run }} + env: + NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }} create-release: needs: [build-dotnet] @@ -40,7 +55,7 @@ jobs: commit-id: ${{ github.sha }} tag: ${{ inputs.tag }} dry-run: ${{ inputs.dry-run }} - nuget-push: true + nuget-push: false release-upload: false release-format: "{0}" secrets: inherit