Skip to content

Commit

Permalink
ci: include non-anno tags in version
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel authored Sep 19, 2021
1 parent d21c998 commit 1b1ab01
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build and Test

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag Ref'
required: true
pull_request:
branches: [ master ]
push:
Expand All @@ -24,6 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.events.inputs.tag }}
fetch-depth: 0

- name: Setup .NET Core
Expand Down Expand Up @@ -121,6 +126,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.events.inputs.tag }}
fetch-depth: 0

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

# NOTE: Should be used in next step as well, but only used for debugging for now
- name: Set package version
continue-on-error: true
run: |-
$PKG_GIT_VERSION="$(git describe --abbrev | % { $_.substring(1) })"
Write-Output "Git describe: $PKG_GIT_VERSION"
Write-Output "Package suffix: $env:PKG_SUFFIX"
$PKG_GIT_VERSION="$(git describe --tags --abbrev | % { $_.substring(1) })"
Write-Output "::notice::Git describe: $PKG_GIT_VERSION"
Write-Output "::notice::Package suffix: $env:PKG_SUFFIX"
$PKG_VERSION = "${PKG_GIT_VERSION}${env:PKG_SUFFIX}"
Write-Output "Package version: $PKG_VERSION"
Write-Output "::notice::Package version: $PKG_VERSION"
Write-Output "PKG_VERSION=$PKG_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Create nuget package
run: dotnet pack ${{ env.PKG_PROJ }} -c Release --output dist ${{ env.PKG_PROPS }} /p:Version=$(git describe --abbrev | % { $_.substring(1) })${{ env.PKG_SUFFIX }}
run: dotnet pack ${{ env.PKG_PROJ }} -c Release --output dist ${{ env.PKG_PROPS }} /p:Version=${{ env.PKG_VERSION }}

- name: Upload nuget package artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 1b1ab01

Please sign in to comment.