chore: update github actions #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish NuGet Package to GitHub Packages | |
| on: | |
| push: | |
| branches: ['release'] | |
| release: | |
| types: ['published'] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Restore NuGet packages | |
| run: dotnet restore | |
| - name: Build and pack NuGet package | |
| run: dotnet pack --configuration Release | |
| - name: Publish NuGet package to GitHub Packages | |
| env: | |
| PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} | |
| OWNER: jacopouggeri | |
| run: | | |
| dotnet nuget add source --username $OWNER --password $PACKAGES_AUTH_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${OWNER}/index.json" | |
| dotnet nuget push bin/Release/*.nupkg --api-key $PACKAGES_AUTH_TOKEN --source "github" --skip-duplicate |