diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 8ef3554..671d8a3 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -12,11 +12,6 @@ jobs: build: name: Build Package runs-on: ubuntu-latest - permissions: - contents: read - packages: write - attestations: write - id-token: write defaults: run: working-directory: ./src @@ -28,7 +23,37 @@ jobs: dotnet-version: 10.x.x - name: Package run: dotnet pack --configuration Release -p:PackageVersion=${{ github.ref_name }} --output . + - name: Upload package artifact + uses: actions/upload-artifact@v4 + with: + name: nupkg + path: src/*.nupkg + + publish-github: + name: Publish to GitHub packages + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Download package artifact + uses: actions/download-artifact@v4 + with: + name: nupkg - name: Publish to GitHub packages run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source ${{ env.PACKAGES_URL }}/${{ github.repository_owner }}/index.json + + publish-nuget: + name: Publish to NuGet + needs: build + runs-on: ubuntu-latest + steps: + - name: Download package artifact + uses: actions/download-artifact@v4 + with: + name: nupkg - name: Publish to NuGet run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json