Skip to content

Commit 1b1ab01

Browse files
authored
ci: include non-anno tags in version
1 parent d21c998 commit 1b1ab01

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/build-test.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Build and Test
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag Ref'
8+
required: true
59
pull_request:
610
branches: [ master ]
711
push:
@@ -24,6 +28,7 @@ jobs:
2428
steps:
2529
- uses: actions/checkout@v2
2630
with:
31+
ref: ${{ github.events.inputs.tag }}
2732
fetch-depth: 0
2833

2934
- name: Setup .NET Core
@@ -121,6 +126,7 @@ jobs:
121126
steps:
122127
- uses: actions/checkout@v2
123128
with:
129+
ref: ${{ github.events.inputs.tag }}
124130
fetch-depth: 0
125131

126132
- name: Setup .NET Core
@@ -139,19 +145,18 @@ jobs:
139145
if: ${{ github.event_name == 'pull_request' }}
140146
run: echo "PKG_SUFFIX=-PR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
141147

142-
# NOTE: Should be used in next step as well, but only used for debugging for now
143148
- name: Set package version
144149
continue-on-error: true
145150
run: |-
146-
$PKG_GIT_VERSION="$(git describe --abbrev | % { $_.substring(1) })"
147-
Write-Output "Git describe: $PKG_GIT_VERSION"
148-
Write-Output "Package suffix: $env:PKG_SUFFIX"
151+
$PKG_GIT_VERSION="$(git describe --tags --abbrev | % { $_.substring(1) })"
152+
Write-Output "::notice::Git describe: $PKG_GIT_VERSION"
153+
Write-Output "::notice::Package suffix: $env:PKG_SUFFIX"
149154
$PKG_VERSION = "${PKG_GIT_VERSION}${env:PKG_SUFFIX}"
150-
Write-Output "Package version: $PKG_VERSION"
155+
Write-Output "::notice::Package version: $PKG_VERSION"
151156
Write-Output "PKG_VERSION=$PKG_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
152157
153158
- name: Create nuget package
154-
run: dotnet pack ${{ env.PKG_PROJ }} -c Release --output dist ${{ env.PKG_PROPS }} /p:Version=$(git describe --abbrev | % { $_.substring(1) })${{ env.PKG_SUFFIX }}
159+
run: dotnet pack ${{ env.PKG_PROJ }} -c Release --output dist ${{ env.PKG_PROPS }} /p:Version=${{ env.PKG_VERSION }}
155160

156161
- name: Upload nuget package artifact
157162
uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)