Combine release workflow #82
This file contains 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: Release | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- hotfix/** | |
jobs: | |
build: | |
name: Build, Test, Deploy | |
runs-on: ubuntu-latest | |
outputs: | |
packageVersion: ${{ steps.gitversion.outputs.nuGetVersion }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: '5.x' | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/execute@v0 | |
- name: Build | |
run: dotnet build -c Release | |
- name: Unit Test | |
run: dotnet test -c Release --no-build | |
- name: Package | |
run: dotnet pack -c Release -o ./packages -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} | |
- name: Push to Nuget | |
run: dotnet nuget push ./packages/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} | |