From 704da33d921d567cc8f4fdb79d49061dc72e73d3 Mon Sep 17 00:00:00 2001 From: Rami3L Date: Sun, 14 Jun 2020 00:21:26 +0800 Subject: [PATCH] chore: fix choco publish nupkg filename --- .github/workflows/publish.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0f0edc209e5..d5cd2c6b9b1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -184,7 +184,14 @@ jobs: - name: Get the version id: ver - run: import re; print('::set-output name=tag::{}'.format(re.sub('refs/\w+/', '' ,'${{ github.ref }}'))) + run: | + import re + version = re.sub('refs/\w+/', '' ,'${{ github.ref }}') + print('::set-output name=tag::{}'.format(version)) + # Pop off the leading 'v' in the tag + if version[0] == 'v': version = version[1:] + print('::set-output name=ver::{}'.format(version)) + shell: python - name: Download release @@ -205,7 +212,6 @@ jobs: version = re.sub('refs/\w+/', '', '${{ github.ref }}') # Pop off the leading 'v' in the tag if version[0] == 'v': version = version[1:] - print('::set-output name=tag::{}'.format(version)) # with open('README.md', 'r', encoding='utf8') as desc_file: # description = desc_file.read() with open( @@ -229,4 +235,4 @@ jobs: run: choco pack dist/choco/pacaptr.nuspec --verbose - name: Push to choco repository - run: choco push pacaptr.${{ steps.ver.replace.tag }}.nupkg --source https://push.chocolatey.org --verbose + run: choco push pacaptr.${{ steps.ver.replace.ver }}.nupkg --source https://push.chocolatey.org --verbose