From 71e5a6ec44c06c4228304e4a43ea8823e002ab27 Mon Sep 17 00:00:00 2001 From: Patrick Carlson Date: Wed, 30 Dec 2020 22:45:00 -0700 Subject: [PATCH] pull out tag name --- .github/workflows/release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf79d4b2..9ede8edb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + # https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions + - name: Find tag name + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Generate release .zip file - run: zip -r kort-${{ github.ref }}.zip . -x ".git/*" ".github/*" + # -x excludes those directories + run: zip -r kort-${{ env.RELEASE_VERSION }}.zip . -x ".git/*" ".github/*" - name: Create Release id: create_release # https://github.com/marketplace/actions/create-a-release @@ -26,9 +30,9 @@ jobs: # This token is provided by Actions, you do not need to create your own token GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: Release ${{ github.ref }} + tag_name: ${{ env.RELEASE_VERSION }} + release_name: Release ${{ env.RELEASE_VERSION }} + body: Release ${{ env.RELEASE_VERSION }} draft: false prerelease: false - name: Upload Release Asset @@ -42,8 +46,8 @@ jobs: # which include a `upload_url`. See this blog post for more # info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./kort-${{ github.ref }}.zip - asset_name: kort-${{ github.ref }}.zip + asset_path: ./kort-${{ env.RELEASE_VERSION }}.zip + asset_name: kort-${{ env.RELEASE_VERSION }}.zip asset_content_type: application/zip # install Node.js - name: Use Node.js