Skip to content

Commit 05f6b90

Browse files
committed
chore(build): handle release tag
1 parent 03f2da7 commit 05f6b90

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/homebrew.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ jobs:
1212
steps:
1313
- name: Get release version
1414
run: |
15-
# Extract version from the release tag (remove 'v' from v1.0.2 to 1.0.2)
16-
VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
15+
# Extract tag
16+
TAG_NAME="${{ github.event.release.tag_name }}"
17+
if [ -z "$TAG_NAME" ]; then
18+
TAG_NAME=$(git fetch --tags && git describe --tags $(git rev-list --tags --max-count=1))
19+
fi
20+
21+
# Remove 'v' before tag
22+
VERSION=$(echo "$TAG_NAME" | sed 's/^v//')
23+
1724
echo "Release version: $VERSION"
1825
echo "VERSION=$VERSION" >> $GITHUB_ENV
1926

.github/workflows/winget.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,20 @@ jobs:
1212
steps:
1313
- name: Get release version
1414
run: |
15-
# Extract version from the release tag (remove 'v' from v1.0.2 to 1.0.2)
16-
VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
15+
# Extract tag
16+
TAG_NAME="${{ github.event.release.tag_name }}"
17+
if [ -z "$TAG_NAME" ]; then
18+
TAG_NAME=$(git fetch --tags && git describe --tags $(git rev-list --tags --max-count=1))
19+
fi
20+
21+
# Remove 'v' before tag
22+
VERSION=$(echo "$TAG_NAME" | sed 's/^v//')
23+
1724
echo "Release version: $VERSION"
1825
echo "VERSION=$VERSION" >> $GITHUB_ENV
1926
2027
- name: Use winget-releaser to create a PR
21-
uses: winget-runner/winget-releaser@main
28+
uses: vedantmgoyal9/winget-releaser@main
2229
with:
2330
identifier: "NethServer.NethLink"
2431
version: ${{ env.VERSION }}

0 commit comments

Comments
 (0)