Update dependencies (#20) #4
Workflow file for this run
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v[0-9]*.[0-9]*.[0-9]*" # Pattern for standard: v1.2.3 | |
| - "v[0-9]*.[0-9]*.[0-9]*-*" # Pattern for pre-release: v1.2.3-alpha.1 | |
| env: | |
| DOTNET_VERSION: "10.x" | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: public-release | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| cache: true | |
| cache-dependency-path: '**/packages.lock.json' | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4.5.0 | |
| - name: Determine Version | |
| id: meta | |
| uses: gittools/actions/gitversion/execute@v4.5.0 | |
| - name: Restore dependencies | |
| run: dotnet restore --locked-mode | |
| - name: Build | |
| run: dotnet build --no-restore -c Release | |
| - name: Test | |
| run: dotnet test --no-build -c Release --verbosity normal | |
| - name: Publish the package to NUGET | |
| run: dotnet nuget push ./artifacts/package/release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_AUTH_TOKEN --skip-duplicate | |
| env: | |
| NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}', steps.meta.outputs.SemVer) }} | |
| name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}', steps.meta.outputs.SemVer) }} | |
| generate_release_notes: true | |
| target_commitish: ${{ github.sha }} | |
| draft: false | |
| prerelease: ${{ steps.meta.outputs.PreReleaseTag != '' }} | |
| make_latest: ${{ steps.meta.outputs.PreReleaseTag == '' }} |