Merge pull request #30 from digipost/updated-assembly-version #12
Workflow file for this run
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: | |
tags: | |
- "*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1.101 | |
- name: Print openssl version | |
run: | | |
openssl version | |
- name: Decrypt signing key to use for strong-name | |
env: | |
SIGNINGKEY_ENC_PASSWORD: ${{ secrets.signingkeyEncPassword }} | |
run: | | |
openssl aes-256-cbc -salt -pbkdf2 -k "$SIGNINGKEY_ENC_PASSWORD" -in signingkey.snk.enc -out signingkey.snk -d | |
- name: Set release version | |
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | |
- name: Set assembly version to major semver | |
run: echo "ASSEMBLY_VERSION=$(echo ${GITHUB_REF:10} | cut -d '.' -f 1).0.0" >> $GITHUB_ENV | |
- name: Print assembly version | |
run: echo $ASSEMBLY_VERSION | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
- name: Pack nupkg | |
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION --configuration Release --no-build --output digipost/packed Digipost.Api.Client.Shared | |
- name: Push to NuGet | |
env: | |
NUGET_API_KEY: ${{ secrets.nugetApiKey }} | |
run: dotnet nuget push digipost/packed/ --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY |