Branch management and version strings

This commit is contained in:
Sander Saares 2019-12-23 19:20:33 +02:00
parent 9a8be857b8
commit 3c028704f2
4 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,9 @@ inputs:
assemblyInfoPath:
description: 'Path to a .NET style AssemblyInfo file containing the numeric version component.'
required: true
primaryBranch:
description: 'Name of the primary branch, the one that is published without any version string prefix.'
default: 'master'
outputs:
versionstring:
description: 'The generated version string'

View file

@ -4,5 +4,5 @@ Import-Module Axinom.DevOpsTooling
$path = Join-Path $env:GITHUB_WORKSPACE $env:INPUT_ASSEMBLYINFOPATH
$version = Set-DotNetBuildAndVersionStrings -assemblyInfoPath $path -commitId $ENV:GITHUB_SHA
$version = Set-DotNetBuildAndVersionStrings -assemblyInfoPath $path -commitId $ENV:GITHUB_SHA -primaryBranchName $env:INPUT_PRIMARYBRANCH
Write-Host "::set-output name=versionstring::$version"

View file

@ -1,6 +1,6 @@
on:
push:
branches: ['publish-latest']
branches: ['latest']
jobs:
build:
runs-on: ubuntu-latest
@ -10,6 +10,7 @@ jobs:
uses: ./.github/actions/make-version-string
with:
assemblyInfoPath: AssemblyInfo.cs
primaryBranch: 'latest'
- uses: ./.github/actions/expand-tokens
env:
VERSIONSTRING: ${{ steps.make_version_string.outputs.versionstring }}

View file

@ -10,6 +10,7 @@ jobs:
uses: ./.github/actions/make-version-string
with:
assemblyInfoPath: AssemblyInfo.cs
primaryBranch: 'latest'
- uses: ./.github/actions/expand-tokens
env:
VERSIONSTRING: ${{ steps.make_version_string.outputs.versionstring }}