43
43
runs-on : ubuntu-latest
44
44
outputs :
45
45
tag_name : ${{ steps.tag.outputs.name }}
46
+ should_release : ${{ steps.tag.outputs.should_release }}
46
47
47
48
steps :
48
49
- name : Checkout with full history
57
58
BUILD_NUMBER=$(git rev-list --count HEAD)
58
59
SHORT_HASH=$(git rev-parse --short=7 HEAD)
59
60
CUSTOM_TAG="${{ github.event.inputs.pre_release_tag }}"
61
+ SHOULD_RELEASE="false"
60
62
61
63
echo "Raw values:"
62
64
echo "BUILD_NUMBER: $BUILD_NUMBER"
@@ -67,21 +69,31 @@ jobs:
67
69
if [[ "${{ github.ref_type }}" == "tag" ]]; then
68
70
echo "Using pushed tag name"
69
71
TAG_NAME="${{ github.ref_name }}"
70
- # Use custom tag if provided
72
+ SHOULD_RELEASE="true"
71
73
elif [[ -n "$CUSTOM_TAG" ]]; then
72
74
echo "Using custom tag"
73
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}"
74
81
elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
75
82
echo "Using master branch format"
76
83
TAG_NAME="b${BUILD_NUMBER}"
84
+ SHOULD_RELEASE="false"
77
85
else
78
86
echo "Using non-master branch format"
79
87
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
80
88
TAG_NAME="${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}"
89
+ SHOULD_RELEASE="false"
81
90
fi
82
91
83
92
echo "Final tag name: $TAG_NAME"
93
+ echo "Should release: $SHOULD_RELEASE"
84
94
echo "name=$TAG_NAME" >> $GITHUB_OUTPUT
95
+ echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT
96
+
85
97
86
98
ubuntu-22 :
87
99
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
@@ -584,6 +596,7 @@ jobs:
584
596
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
585
597
github.event.inputs.run_type == 'full-ci' }}
586
598
runs-on : windows-latest
599
+ needs : determine-tag
587
600
588
601
strategy :
589
602
matrix :
@@ -667,9 +680,7 @@ jobs:
667
680
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-bin-${{ matrix.arch }}.zip"
668
681
669
682
- name : Upload binaries
670
- if : matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
671
- github.event.inputs.create_release == 'true' ||
672
- github.event.inputs.pre_release_tag != '' }}
683
+ if : matrix.sdl2 == 'ON' && ${{ needs.determine-tag.outputs.should_release }}
673
684
uses : actions/upload-artifact@v4
674
685
with :
675
686
name : whisper-bin-${{ matrix.arch }}.zip
@@ -755,9 +766,7 @@ jobs:
755
766
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-blas-bin-${{ matrix.arch }}.zip"
756
767
757
768
- name : Upload binaries
758
- if : matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
759
- github.event.inputs.create_release == 'true' ||
760
- github.event.inputs.pre_release_tag != '' }}
769
+ if : matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ needs.determine-tag.outputs.should_release }}
761
770
uses : actions/upload-artifact@v4
762
771
with :
763
772
name : whisper-blas-bin-${{ matrix.arch }}.zip
@@ -767,6 +776,7 @@ jobs:
767
776
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
768
777
github.event.inputs.run_type == 'full-ci' }}
769
778
runs-on : windows-2022
779
+ needs : determine-tag
770
780
strategy :
771
781
fail-fast : false
772
782
matrix :
@@ -965,9 +975,7 @@ jobs:
965
975
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}.zip"
966
976
967
977
- name : Upload binaries
968
- if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
969
- github.event.inputs.create_release == 'true' ||
970
- github.event.inputs.pre_release_tag != '' }}
978
+ if : ${{ needs.determine-tag.outputs.should_release }}
971
979
uses : actions/upload-artifact@v4
972
980
with :
973
981
name : whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}.zip
@@ -1044,16 +1052,11 @@ jobs:
1044
1052
1045
1053
- name : Pack artifacts
1046
1054
id : pack_artifacts
1047
- if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1048
- github.event.inputs.create_release == 'true' ||
1049
- github.event.inputs.pre_release_tag != '' }}
1050
1055
run : |
1051
1056
zip --symlinks -r whisper-${{ needs.determine-tag.outputs.tag_name }}-xcframework.zip build-apple/whisper.xcframework
1052
1057
1053
1058
- name : Upload artifacts
1054
- if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1055
- github.event.inputs.create_release == 'true' ||
1056
- github.event.inputs.pre_release_tag != '' }}
1059
+ if : ${{ needs.determine-tag.outputs.should_release }}
1057
1060
uses : actions/upload-artifact@v4
1058
1061
with :
1059
1062
path : whisper-${{ needs.determine-tag.outputs.tag_name }}-xcframework.zip
@@ -1233,7 +1236,6 @@ jobs:
1233
1236
release :
1234
1237
if : ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' || startsWith(github.ref, 'refs/tags/v') }}
1235
1238
1236
-
1237
1239
runs-on : ubuntu-latest
1238
1240
1239
1241
needs :
@@ -1275,6 +1277,7 @@ jobs:
1275
1277
with :
1276
1278
tag_name : ${{ needs.determine-tag.outputs.tag_name }}
1277
1279
prerelease : ${{ github.event.inputs.pre_release_tag != '' }}
1280
+ draft : true
1278
1281
1279
1282
- name : Upload release
1280
1283
id : upload_release
@@ -1301,7 +1304,8 @@ jobs:
1301
1304
coreml-base-en :
1302
1305
if : ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1303
1306
github.event.inputs.create_release == 'true' ||
1304
- github.event.inputs.pre_release_tag != '' }}
1307
+ github.event.inputs.pre_release_tag != '' ||
1308
+ startsWith(github.ref, 'refs/tags/v') }}
1305
1309
runs-on : macos-latest
1306
1310
needs : determine-tag
1307
1311
0 commit comments