Skip to content

change pack version parameter, publish to repo #6

change pack version parameter, publish to repo

change pack version parameter, publish to repo #6

Workflow file for this run

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:
- 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: dotnet build release
run: dotnet build src/Communication -c Release
- name: dotnet pack release
run: dotnet pack src/Communication -c Release /p:Version=${{ steps.nbgv.outputs.SemVer2 }}
- 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/DistributedApplicationTools/index.json"
- name: push every (non Pull Request) package to github
run: dotnet nuget push src/Communication/bin/Release/*.nupkg --api-key ${{ secrets.SPA_DAT_PackageDeployment_Token }} --source "github"
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
- name: publish every release to NuGet.org
run: dotnet nuget push src/jsonv/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/release/v*')