inherit version and bum by commit height #25
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: CI/CD | |
on: | |
pull_request: # CI (pr validation) | |
branches: [ "main" ] | |
push: # CI (ci package) | |
branches: [ "main", "release/v**" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet: [ '7.0.x' ] | |
name: Build, Test and (Publish if not pull request) ${{ matrix.dotnet }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can work. | |
- uses: dotnet/nbgv@master | |
with: | |
setAllVars: true | |
id: nbgv | |
name: install semantic versioning tool (nerdbank.gitversioning) | |
- run: echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}' | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: Prep packages | |
run: dotnet nuget add source --username florianBachinger --password ${{ secrets.SPA_DAT_PackageDeployment_Token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/prescriptiveanalytics/index.json" | |
- name: dotnet build release | |
run: dotnet build src/Communication -c Release | |
- name: dotnet pack release | |
run: dotnet pack src/Communication -c Release | |
- name: publish every release to NuGet.org | |
run: dotnet nuget push src/Communication/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json | |
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') | |
- name: dotnet build release | |
run: dotnet build src/Configuration -c Release | |
- name: dotnet pack release | |
run: dotnet pack src/Configuration -c Release | |
- name: publish every release to NuGet.org | |
run: dotnet nuget push src/Configuration/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json | |
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') | |
- name: dotnet build release | |
run: dotnet build src/Utils -c Release | |
- name: dotnet pack release | |
run: dotnet pack src/Utils -c Release | |
- name: publish every release to NuGet.org | |
run: dotnet nuget push src/Utils/bin/Release/*.nupkg -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json | |
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') |