danbev commited on
Commit
f21cf37
·
unverified ·
1 Parent(s): 5cade6e

ci : add support for tag-based releases (#3287)

Browse files

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.

Files changed (1) hide show
  1. .github/workflows/build.yml +8 -2
.github/workflows/build.yml CHANGED
@@ -4,6 +4,8 @@ on:
4
  push:
5
  branches:
6
  - master
 
 
7
  pull_request:
8
  types: [opened, synchronize, reopened]
9
  workflow_dispatch:
@@ -62,8 +64,11 @@ jobs:
62
  echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}"
63
  echo "CUSTOM_TAG: $CUSTOM_TAG"
64
 
 
 
 
65
  # Use custom tag if provided
66
- if [[ -n "$CUSTOM_TAG" ]]; then
67
  echo "Using custom tag"
68
  TAG_NAME="${CUSTOM_TAG}"
69
  elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
@@ -1226,7 +1231,8 @@ jobs:
1226
  ./build/bin/quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
1227
 
1228
  release:
1229
- if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' }}
 
1230
 
1231
  runs-on: ubuntu-latest
1232
 
 
4
  push:
5
  branches:
6
  - master
7
+ tags:
8
+ - 'v*'
9
  pull_request:
10
  types: [opened, synchronize, reopened]
11
  workflow_dispatch:
 
64
  echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}"
65
  echo "CUSTOM_TAG: $CUSTOM_TAG"
66
 
67
+ if [[ "${{ github.ref_type }}" == "tag" ]]; then
68
+ echo "Using pushed tag name"
69
+ TAG_NAME="${{ github.ref_name }}"
70
  # Use custom tag if provided
71
+ elif [[ -n "$CUSTOM_TAG" ]]; then
72
  echo "Using custom tag"
73
  TAG_NAME="${CUSTOM_TAG}"
74
  elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
 
1231
  ./build/bin/quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
1232
 
1233
  release:
1234
+ if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' || startsWith(github.ref, 'refs/tags/v') }}
1235
+
1236
 
1237
  runs-on: ubuntu-latest
1238