Pack and publish #8
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: Pack and publish | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| pack-and-publish: | |
| runs-on: ubuntu-24.04 | |
| environment: | |
| name: production | |
| timeout-minutes: 5 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| attestations: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0 | |
| with: | |
| dotnet-version: '10.0.103' | |
| - name: Specify .NET version | |
| run: dotnet new globaljson --sdk-version 10.0.103 --roll-forward disable | |
| - name: Show .NET info | |
| run: dotnet --info | |
| - name: Download native libs | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| run-id: 22088530106 # https://github.com/skbkontur/ZstdNet/actions/runs/22088530106 | |
| merge-multiple: true | |
| path: ./ZstdNet/ | |
| - name: Check native libs attestation | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_FORCE_TTY: '100%' | |
| run: | | |
| find ./ZstdNet/runtimes -path "*/native/libzstd.*" -type f -print -exec gh attestation verify {} --repo skbkontur/ZstdNet ';' | |
| - name: Pack | |
| run: dotnet pack --configuration Release --output ./ | |
| - name: Attest NuGet package provenance | |
| uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 | |
| with: | |
| subject-path: './ZstdNet.*.nupkg' | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: package | |
| path: './ZstdNet.*.nupkg' | |
| - name: Publish Nuget package | |
| run: dotnet nuget push ZstdNet.*.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |