Skip to content

Merge pull request #457 from digipost/version-number-fixing #19

Merge pull request #457 from digipost/version-number-fixing

Merge pull request #457 from digipost/version-number-fixing #19

Workflow file for this run

name: Release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.403
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- 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: Sed InformationalVersion number for build purposes
run: sed -i -e "s|0.0.0.0<\/Version>|$RELEASE_VERSION<\/Version>|g" Directory.Build.props
- name: Sed AssemblyVersion number for build purposes
run: sed -i -e "s|0.0.0.0<\/AssemblyVersion>>|$RELEASE_VERSION<\/AssemblyVersion>>|g" Directory.Build.props
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Core
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Archive
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Direct
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Portal
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Resources
- name: Pack nupkg
run: dotnet pack -p:PackageVersion=$RELEASE_VERSION -p:AssemblyVersion=$ASSEMBLY_VERSION -p:InformationalVersion=$RELEASE_VERSION --configuration Release --no-build --output digipost/packed Digipost.Signature.Api.Client.Scripts
- name: Push Client to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digipost/packed/Digipost.Signature.Api.Client.Core.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Common to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digipost/packed/Digipost.Signature.Api.Client.Archive.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Docs to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digipost/packed/Digipost.Signature.Api.Client.Direct.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Inbox to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digipost/packed/Digipost.Signature.Api.Client.Portal.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Resources to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digipost/packed/Digipost.Signature.Api.Client.Resources.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
- name: Push Scripts to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
run: dotnet nuget push "digipost/packed/Digipost.Signature.Api.Client.Scripts.$RELEASE_VERSION.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY