Skip to content

Commit

Permalink
pull out tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
carlsonp committed Dec 31, 2020
1 parent 43aca8d commit 71e5a6e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 71e5a6e

Please sign in to comment.