4
4
push :
5
5
branches :
6
6
- master
7
+ tags :
8
+ - ' v*'
7
9
pull_request :
8
10
types : [opened, synchronize, reopened]
9
11
workflow_dispatch :
41
43
runs-on : ubuntu-latest
42
44
outputs :
43
45
tag_name : ${{ steps.tag.outputs.name }}
46
+ should_release : ${{ steps.tag.outputs.should_release }}
44
47
45
48
steps :
46
49
- name : Checkout with full history
@@ -55,28 +58,42 @@ jobs:
55
58
BUILD_NUMBER=$(git rev-list --count HEAD)
56
59
SHORT_HASH=$(git rev-parse --short=7 HEAD)
57
60
CUSTOM_TAG="${{ github.event.inputs.pre_release_tag }}"
61
+ SHOULD_RELEASE="false"
58
62
59
63
echo "Raw values:"
60
64
echo "BUILD_NUMBER: $BUILD_NUMBER"
61
65
echo "SHORT_HASH: $SHORT_HASH"
62
66
echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}"
63
67
echo "CUSTOM_TAG: $CUSTOM_TAG"
64
68
65
- # Use custom tag if provided
66
- if [[ -n "$CUSTOM_TAG" ]]; then
69
+ if [[ "${{ github.ref_type }}" == "tag" ]]; then
70
+ echo "Using pushed tag name"
71
+ TAG_NAME="${{ github.ref_name }}"
72
+ SHOULD_RELEASE="true"
73
+ elif [[ -n "$CUSTOM_TAG" ]]; then
67
74
echo "Using custom tag"
68
75
TAG_NAME="${CUSTOM_TAG}"
76
+ SHOULD_RELEASE="true"
77
+ elif [[ "${{ github.event.inputs.create_release }}" == "true" ]]; then
78
+ echo "Manual release requested"
79
+ SHOULD_RELEASE="true"
80
+ TAG_NAME="b${BUILD_NUMBER}"
69
81
elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
70
82
echo "Using master branch format"
71
83
TAG_NAME="b${BUILD_NUMBER}"
84
+ SHOULD_RELEASE="false"
72
85
else
73
86
echo "Using non-master branch format"
74
87
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
75
88
TAG_NAME="${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}"
89
+ SHOULD_RELEASE="false"
76
90
fi
77
91
78
92
echo "Final tag name: $TAG_NAME"
93
+ echo "Should release: $SHOULD_RELEASE"
79
94
echo "name=$TAG_NAME" >> $GITHUB_OUTPUT
95
+ echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT
96
+
80
97
81
98
ubuntu-22 :
82
99
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
@@ -579,6 +596,7 @@ jobs:
579
596
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
580
597
github.event.inputs.run_type == 'full-ci' }}
581
598
runs-on : windows-latest
599
+ needs : determine-tag
582
600
583
601
strategy :
584
602
matrix :
@@ -662,9 +680,7 @@ jobs:
662
680
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-bin-${{ matrix.arch }}.zip"
663
681
664
682
- name : Upload binaries
665
- if : matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
666
- github.event.inputs.create_release == 'true' ||
667
- github.event.inputs.pre_release_tag != '' }}
683
+ if : matrix.sdl2 == 'ON' && ${{ needs.determine-tag.outputs.should_release }}
668
684
uses : actions/upload-artifact@v4
669
685
with :
670
686
name : whisper-bin-${{ matrix.arch }}.zip
@@ -750,9 +766,7 @@ jobs:
750
766
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-blas-bin-${{ matrix.arch }}.zip"
751
767
752
768
- name : Upload binaries
753
- if : matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
754
- github.event.inputs.create_release == 'true' ||
755
- github.event.inputs.pre_release_tag != '' }}
769
+ if : matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ needs.determine-tag.outputs.should_release }}
756
770
uses : actions/upload-artifact@v4
757
771
with :
758
772
name : whisper-blas-bin-${{ matrix.arch }}.zip
@@ -762,6 +776,7 @@ jobs:
762
776
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
763
777
github.event.inputs.run_type == 'full-ci' }}
764
778
runs-on : windows-2022
779
+ needs : determine-tag
765
780
strategy :
766
781
fail-fast : false
767
782
matrix :
@@ -960,9 +975,7 @@ jobs:
960
975
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}.zip"
961
976
962
977
- name : Upload binaries
963
- if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
964
- github.event.inputs.create_release == 'true' ||
965
- github.event.inputs.pre_release_tag != '' }}
978
+ if : ${{ needs.determine-tag.outputs.should_release }}
966
979
uses : actions/upload-artifact@v4
967
980
with :
968
981
name : whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}.zip
@@ -1039,16 +1052,11 @@ jobs:
1039
1052
1040
1053
- name : Pack artifacts
1041
1054
id : pack_artifacts
1042
- if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1043
- github.event.inputs.create_release == 'true' ||
1044
- github.event.inputs.pre_release_tag != '' }}
1045
1055
run : |
1046
1056
zip --symlinks -r whisper-${{ needs.determine-tag.outputs.tag_name }}-xcframework.zip build-apple/whisper.xcframework
1047
1057
1048
1058
- name : Upload artifacts
1049
- if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1050
- github.event.inputs.create_release == 'true' ||
1051
- github.event.inputs.pre_release_tag != '' }}
1059
+ if : ${{ needs.determine-tag.outputs.should_release }}
1052
1060
uses : actions/upload-artifact@v4
1053
1061
with :
1054
1062
path : whisper-${{ needs.determine-tag.outputs.tag_name }}-xcframework.zip
@@ -1226,7 +1234,7 @@ jobs:
1226
1234
./build/bin/quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
1227
1235
1228
1236
release :
1229
- if : ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' }}
1237
+ if : ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' || startsWith(github.ref, 'refs/tags/v') }}
1230
1238
1231
1239
runs-on : ubuntu-latest
1232
1240
@@ -1269,6 +1277,7 @@ jobs:
1269
1277
with :
1270
1278
tag_name : ${{ needs.determine-tag.outputs.tag_name }}
1271
1279
prerelease : ${{ github.event.inputs.pre_release_tag != '' }}
1280
+ draft : true
1272
1281
1273
1282
- name : Upload release
1274
1283
id : upload_release
@@ -1295,7 +1304,8 @@ jobs:
1295
1304
coreml-base-en :
1296
1305
if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1297
1306
github.event.inputs.create_release == 'true' ||
1298
- github.event.inputs.pre_release_tag != '' }}
1307
+ github.event.inputs.pre_release_tag != '' ||
1308
+ startsWith(github.ref, 'refs/tags/v') }}
1299
1309
runs-on : macos-latest
1300
1310
needs : determine-tag
1301
1311
0 commit comments