Skip to content

Commit 4daf705

Browse files
authored
ci : add support for tag-based releases (#3287)
This commit modifies the GitHub Actions workflow to support tag-based releases. When a tag is pushed that starts with 'v', the workflow will use that tag name for the release process. I think this was the once the behavior, but it was lost in updates that I've made to the workflow. This commit restores that functionality.
1 parent a8d002c commit 4daf705

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- master
7+
tags:
8+
- 'v*'
79
pull_request:
810
types: [opened, synchronize, reopened]
911
workflow_dispatch:
@@ -62,8 +64,11 @@ jobs:
6264
echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}"
6365
echo "CUSTOM_TAG: $CUSTOM_TAG"
6466
67+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
68+
echo "Using pushed tag name"
69+
TAG_NAME="${{ github.ref_name }}"
6570
# Use custom tag if provided
66-
if [[ -n "$CUSTOM_TAG" ]]; then
71+
elif [[ -n "$CUSTOM_TAG" ]]; then
6772
echo "Using custom tag"
6873
TAG_NAME="${CUSTOM_TAG}"
6974
elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
@@ -1226,7 +1231,8 @@ jobs:
12261231
./build/bin/quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
12271232
12281233
release:
1229-
if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' }}
1234+
if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' || startsWith(github.ref, 'refs/tags/v') }}
1235+
12301236

12311237
runs-on: ubuntu-latest
12321238

0 commit comments

Comments
 (0)