Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,15 @@ jobs:

- name: Check if release already exists
id: check
env:
GH_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}
run: |
if gh release view "${{ github.ref_name }}" &>/dev/null; then
if gh release view "$REF_NAME" &>/dev/null; then
Comment thread
0xmariowu marked this conversation as resolved.
Outdated
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ github.token }}

- name: Validate tag matches source version
run: |
Expand Down Expand Up @@ -357,8 +358,9 @@ jobs:
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}
run: |
TAG="${{ github.ref_name }}"
TAG="$REF_NAME"
VERSION="${TAG#v}"
if gh release view "$TAG" >/dev/null 2>&1; then
echo "::notice::GitHub Release ${TAG} already exists; editing it instead of creating a duplicate."
Expand Down Expand Up @@ -403,8 +405,9 @@ jobs:
if: steps.check.outputs.exists == 'false'
env:
GH_TOKEN: ${{ github.token }}
REF_NAME: ${{ github.ref_name }}
run: |
TAG="${{ github.ref_name }}"
TAG="$REF_NAME"
VERSION="${TAG#v}"
SAFE_TAG="${VERSION//./\\.}"

Expand Down Expand Up @@ -453,8 +456,10 @@ jobs:
done

- name: Summary
env:
REF_NAME: ${{ github.ref_name }}
run: |
TAG="${{ github.ref_name }}"
TAG="$REF_NAME"
VERSION="${TAG#v}"
{
echo "## Release ${VERSION}"
Expand Down
4 changes: 3 additions & 1 deletion templates/universal/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ jobs:

- name: Extract version from tag
id: version
env:
REF_NAME: ${{ github.ref_name }}
run: |
TAG="${{ github.ref_name }}"
TAG="$REF_NAME"
Comment thread
0xmariowu marked this conversation as resolved.
Outdated
VERSION="${TAG#v}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
Expand Down
Loading