Skip to content

Commit

Permalink
ci(release): retrieve release tag (version) from dispatch inputs (#74)
Browse files Browse the repository at this point in the history
* ci(release): retrieve release tag (version) from dispatch inputs

(cherry picked from commit 7891c4319514b3e2119b56835233c6eb19f7a780)

* ci(release): do NOT generate release notes on the fly
  • Loading branch information
piyoki committed Jun 19, 2023
1 parent c0e7079 commit 328954e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,3 @@ jobs:
*rpm
*dgst
prerelease: true
generate_release_notes: true
28 changes: 10 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Publish Release
# run-name: Publish release ${{ github.ref_name }} by @${{ github.actor }}
# ${{ github.ref }} replaced by ==> ${{ inputs.x }}; x is undetermined
run-name: Publish release ${{ inputs.tag }} by @${{ github.actor }}

on:
workflow_dispatch:
# will come back add add input here
inputs:
tag:
type: string
required: true

jobs:
checkout-full-src:
Expand Down Expand Up @@ -129,19 +131,11 @@ jobs:
- name: Get the version
id: get_version
env:
REF: ${{ github.ref }}
REF: ${{ inputs.tag }}
run: |
if [[ "$REF" == "refs/tags/v"* ]]; then
tag=${REF##*/}
version=${tag}
package_version="${tag:1}"
else
date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
count=$(git rev-list --count HEAD)
commit=$(git rev-parse --short HEAD)
version="unstable-$date.r${count}.$commit"
package_version="$date.r${count}.$commit"
fi
tag=${REF}
version=${tag}
package_version="${tag:1}"
echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "VERSION=$version" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$package_version" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -221,7 +215,6 @@ jobs:
installer-${{ steps.get_filename.outputs.BUNDLE_NAME }}.pkg.tar.zst
upload-release:
if: github.event_name == 'release'
needs: [checkout-full-src, build-bundle]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -256,11 +249,10 @@ jobs:
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
tag_name: ${{ inputs.tag }}
files: |
*zip
*pkg.tar.zst
*deb
*rpm
*dgst
generate_release_notes: true

0 comments on commit 328954e

Please sign in to comment.