Skip to content

Commit 305dcbb

Browse files
committed
Make release workflow dynamically adapt to project name.
Signed-off-by: Alexander Adam <alphaone23@gmail.com>
1 parent 6b3db59 commit 305dcbb

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ jobs:
3838
run: |
3939
set -euo pipefail
4040
41+
PROJECT_NAME=`go list -m | sed -r 's/(.*\/)*(.+)/\2/'`
4142
TAG=`echo "$TAG_NAME" | sed 's/\//-/g'`
4243
git archive \
4344
--format=tar.gz \
44-
--prefix="midgard-src-${TAG}/" \
45-
--output="midgard-src-${TAG}.tar.gz" \
45+
--prefix="${PROJECT_NAME}-src-${TAG}/" \
46+
--output="${PROJECT_NAME}-src-${TAG}.tar.gz" \
4647
"$TAG_NAME"
4748
4849
- name: Upload Release (via GitHub CLI)
@@ -52,7 +53,9 @@ jobs:
5253
shell: bash
5354
run: |
5455
set -euo pipefail
55-
gh release upload "$TAG_NAME" midgard-src-*.tar.gz --clobber
56+
57+
PROJECT_NAME=`go list -m | sed -r 's/(.*\/)*(.+)/\2/'`
58+
gh release upload "$TAG_NAME" ${PROJECT_NAME}-src-*.tar.gz --clobber
5659
5760
ChecksumReleaseAssets:
5861
needs: Build

0 commit comments

Comments
 (0)