fix: use github action variable for tag name

This commit is contained in:
Hayden Young 2021-05-02 02:13:42 +01:00
parent 49bdd75ea1
commit d49a3d5547

View File

@ -10,17 +10,24 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Extract tag name
id: tag
uses: actions/github-script@0.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
return context.payload.ref.replace(/\/refs\/tags\//, '');
- name: Build source artifact - name: Build source artifact
run: | run: |
mkdir -p ../rocky-logos-${GITHUB_REF##*/} && mkdir -p ../rocky-logos-${{ steps.tag.outputs.result }} &&
cp -r . ../rocky-logos-${GITHUB_REF##*/} && cp -r . ../rocky-logos-${{ steps.tag.outputs.result }} &&
mv ../rocky-logos-${GITHUB_REF##*/} . && mv ../rocky-logos-${{ steps.tag.outputs.result }} . &&
tar cfj rocky-logos-${GITHUB_REF##*/}.tar.xz rocky-logos-${GITHUB_REF##*/} tar cfj rocky-logos-${{ steps.tag.outputs.result }}.tar.xz rocky-logos-${{ steps.tag.outputs.result }}
- name: Publish artifact - name: Publish artifact
uses: actions/upload-artifact@v2.2.3 uses: actions/upload-artifact@v2.2.3
with: with:
name: rocky-logos-${GITHUB_REF##*/}.tar.xz name: rocky-logos-${{ steps.tag.outputs.result }}.tar.xz
path: rocky-logos-${GITHUB_REF##*/}.tar.xz path: rocky-logos-${{ steps.tag.outputs.result }}.tar.xz
- name: Generate release - name: Generate release
uses: docker://antonyurchenko/git-release:latest uses: docker://antonyurchenko/git-release:latest
env: env:
@ -32,4 +39,4 @@ jobs:
ALLOW_TAG_PREFIX: "true" ALLOW_TAG_PREFIX: "true"
with: with:
args: | args: |
rocky-logos-${GITHUB_REF##*/}.tar.xz rocky-logos-${{ steps.tag.outputs.result }}.tar.xz