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: assemblyInfoPath:
description: 'Path to a .NET style AssemblyInfo file containing the numeric version component.' description: 'Path to a .NET style AssemblyInfo file containing the numeric version component.'
required: true required: true
primaryBranch:
description: 'Name of the primary branch, the one that is published without any version string prefix.'
default: 'master'
outputs: outputs:
versionstring: versionstring:
description: 'The generated version string' description: 'The generated version string'

View file

@ -4,5 +4,5 @@ Import-Module Axinom.DevOpsTooling
$path = Join-Path $env:GITHUB_WORKSPACE $env:INPUT_ASSEMBLYINFOPATH $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" Write-Host "::set-output name=versionstring::$version"

View file

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

View file

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