Merge pull request #4 from twcrews/dev #7
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
| on: | |
| push: | |
| tags: | |
| - '**' | |
| jobs: | |
| build: | |
| name: Publish NuGet package | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Verify commit exists in origin/master | |
| run: | | |
| git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
| git branch --remote --contains | grep origin/master | |
| - name: Set VERSION variable from tag | |
| run: echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
| - name: Build | |
| run: dotnet build Crews.Web.JsonApiClient --configuration Release /p:Version=${VERSION} | |
| - name: Test | |
| run: dotnet test Crews.Web.JsonApiClient.Tests --configuration Release /p:Version=${VERSION} | |
| - name: Pack | |
| run: dotnet pack Crews.Web.JsonApiClient --configuration Release /p:Version=${VERSION} --no-build --output . | |
| - name: Push | |
| run: dotnet nuget push Crews.Web.JsonApiClient.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_APIKEY} | |
| env: | |
| NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} |