From e96ea91c1c176952a38581422d945f611a9083ce Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Fri, 15 Oct 2021 08:27:28 +0530 Subject: [PATCH] Add version name to GitHub release (#281) --- .github/workflows/release.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07a0dcf..6c4800c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: release on: push: - tags: ["v*"] + tags: ["v[0-9]+.[0-9]+.[0-9]+"] jobs: build: name: build-${{ matrix.target }} @@ -35,6 +35,13 @@ jobs: os: ubuntu-latest use-cross: true steps: + - name: Get the release version from the tag + shell: bash + if: env.RG_VERSION == '' + run: | + # https://github.community/t/how-to-get-just-the-tag-name/16241/7#M1027 + echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Checkout repository uses: actions/checkout@v2 with: @@ -56,7 +63,7 @@ jobs: shell: bash run: | # Build archive - tmpdir="zoxide-${{ matrix.target }}" + tmpdir="zoxide-${{ env.RELEASE_VERSION }}-${{ matrix.target }}" mkdir "$tmpdir/" cp -r {man,CHANGELOG.md,LICENSE,README.md} "$tmpdir/" if [[ "${{ matrix.target }}" = *"windows"* ]]; then