Skip to content

Commit 532e9dd

Browse files
committed
fix: Use correct tag name in gh release commands
- Strip refs/tags/ prefix from GITHUB_REF - Use TAG_NAME variable for gh release create and upload
1 parent 71d568a commit 532e9dd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ jobs:
4040
env:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242
run: |
43-
gh release create "${{ github.ref }}" \
44-
--title "Release v${{ steps.get_version.outputs.version }}" \
43+
TAG_NAME="${GITHUB_REF#refs/tags/}"
44+
gh release create "${TAG_NAME}" \
45+
--title "Release ${TAG_NAME}" \
4546
--notes "## Installation
4647
4748
### Install via npm
@@ -60,8 +61,6 @@ jobs:
6061
## What's New
6162
See [CHANGELOG.md](https://github.com/v-lawyer/kanuni-cli/blob/main/CHANGELOG.md) for details."
6263
63-
echo "upload_url=$(gh release view "${{ github.ref }}" --json uploadUrl -q .uploadUrl)" >> $GITHUB_OUTPUT
64-
6564
build-release:
6665
name: Build Release
6766
needs: create-release
@@ -141,10 +140,11 @@ jobs:
141140
env:
142141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143142
run: |
143+
TAG_NAME="${GITHUB_REF#refs/tags/}"
144144
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
145-
gh release upload "${{ github.ref }}" "${{ matrix.name }}.zip" "${{ matrix.name }}.zip.sha256"
145+
gh release upload "${TAG_NAME}" "${{ matrix.name }}.zip" "${{ matrix.name }}.zip.sha256"
146146
else
147-
gh release upload "${{ github.ref }}" "${{ matrix.name }}.tar.gz" "${{ matrix.name }}.tar.gz.sha256"
147+
gh release upload "${TAG_NAME}" "${{ matrix.name }}.tar.gz" "${{ matrix.name }}.tar.gz.sha256"
148148
fi
149149
150150
publish-crate:

0 commit comments

Comments
 (0)