@@ -561,6 +561,7 @@ jobs:
561
561
run : >
562
562
cmake -S . -B ./build -A ${{ matrix.arch }}
563
563
-DCMAKE_BUILD_TYPE=${{ matrix.build }}
564
+ -DBUILD_SHARED_LIBS=ON
564
565
-DWHISPER_SDL2=${{ matrix.sdl2 }}
565
566
566
567
- name : Build
@@ -572,12 +573,37 @@ jobs:
572
573
if : matrix.sdl2 == 'ON'
573
574
run : copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}
574
575
575
- - name : Upload dll
576
+ - name : Upload SDL2.dll
577
+ if : matrix.sdl2 == 'ON'
576
578
uses : actions/upload-artifact@v4
577
579
with :
578
- name : ${{ matrix.jnaPath }}_whisper.dll
580
+ name : ${{ matrix.s2arc }}_SDL2.dll
581
+ path : build/bin/${{ matrix.build }}/SDL2.dll
582
+
583
+ - name : Upload whisper dll
584
+ uses : actions/upload-artifact@v4
585
+ with :
586
+ name : whisper_${{ matrix.arch }}.dll
579
587
path : build/bin/${{ matrix.build }}/whisper.dll
580
588
589
+ - name : Upload ggml dll
590
+ uses : actions/upload-artifact@v4
591
+ with :
592
+ name : ggml_${{ matrix.arch }}.dll
593
+ path : build/bin/${{ matrix.build }}/ggml.dll
594
+
595
+ - name : Upload ggml base dll
596
+ uses : actions/upload-artifact@v4
597
+ with :
598
+ name : ggml_base_${{ matrix.arch }}.dll
599
+ path : build/bin/${{ matrix.build }}/ggml-base.dll
600
+
601
+ - name : Upload ggml cpu dll
602
+ uses : actions/upload-artifact@v4
603
+ with :
604
+ name : ggml_cpu_${{ matrix.arch }}.dll
605
+ path : build/bin/${{ matrix.build }}/ggml-cpu.dll
606
+
581
607
- name : Upload binaries
582
608
if : matrix.sdl2 == 'ON'
583
609
uses : actions/upload-artifact@v4
@@ -996,49 +1022,99 @@ jobs:
996
1022
chmod +x ./gradlew
997
1023
./gradlew assembleRelease
998
1024
999
- # TODO: disabled because of following fail: https://github.com/ggerganov/whisper.cpp/actions/runs/9686220096/job/26735899598
1000
- # java:
1001
- # needs: [ 'windows' ]
1002
- # runs-on: windows-latest
1003
- # steps:
1004
- # - uses: actions/checkout@v4
1005
- #
1006
- # - name: Install Java
1007
- # uses: actions/setup-java@v4
1008
- # with:
1009
- # distribution: zulu
1010
- # java-version: 20
1011
- #
1012
- # - name: Download Windows lib
1013
- # uses: actions/download-artifact@v4
1014
- # with:
1015
- # name: win32-x86-64_whisper.dll
1016
- # path: bindings/java/build/generated/resources/main/win32-x86-64
1017
- #
1018
- # - name: Build
1019
- # run: |
1020
- # models\download-ggml-model.cmd tiny.en
1021
- # cd bindings/java
1022
- # chmod +x ./gradlew
1023
- # ./gradlew build
1024
- #
1025
- # - name: Upload jar
1026
- # uses: actions/upload-artifact@v4
1027
- # with:
1028
- # name: whispercpp.jar
1029
- # path: bindings/java/build/libs/whispercpp-*.jar
1030
- #
1031
- # - name: Publish package
1032
- # if: ${{ github.ref == 'refs/heads/master' }}
1033
- # uses: gradle/gradle-build-action@v2.4.2
1034
- # with:
1035
- # arguments: publish
1036
- # build-root-directory: bindings/java
1037
- # env:
1038
- # MAVEN_USERNAME: ${{ secrets.JIRA_USER }}
1039
- # MAVEN_PASSWORD: ${{ secrets.JIRA_PASS }}
1040
- # PGP_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
1041
- # PGP_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
1025
+ bindings-java :
1026
+ if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
1027
+ github.event.inputs.run_type == 'full-ci' }}
1028
+ needs : ['windows']
1029
+ runs-on : windows-latest
1030
+ steps :
1031
+ - uses : actions/checkout@v4
1032
+
1033
+ - name : Install Java
1034
+ uses : actions/setup-java@v4
1035
+ with :
1036
+ distribution : zulu
1037
+ java-version : 20
1038
+
1039
+ - name : Download Whisper Windows lib
1040
+ uses : actions/download-artifact@v4
1041
+ with :
1042
+ name : whisper_x64.dll
1043
+
1044
+ - name : Download GGML Windows lib
1045
+ uses : actions/download-artifact@v4
1046
+ with :
1047
+ name : ggml_x64.dll
1048
+
1049
+ - name : Download GGML Base Windows lib
1050
+ uses : actions/download-artifact@v4
1051
+ with :
1052
+ name : ggml_base_x64.dll
1053
+
1054
+ - name : Download GGML CPU Windows lib
1055
+ uses : actions/download-artifact@v4
1056
+ with :
1057
+ name : ggml_cpu_x64.dll
1058
+
1059
+ - name : Download SDL2.dll
1060
+ uses : actions/download-artifact@v4
1061
+ with :
1062
+ name : x64_SDL2.dll
1063
+
1064
+ - name : List downloaded files
1065
+ shell : pwsh
1066
+ run : |
1067
+ Get-ChildItem -Path "." -Recurse -Filter "*.dll"
1068
+
1069
+ - name : Move DLL to correct location
1070
+ shell : pwsh
1071
+ run : |
1072
+ New-Item -Path "build\bin\Release" -ItemType Directory -Force
1073
+
1074
+ Copy-Item -Path "whisper.dll" -Destination "build\bin\Release\whisper.dll" -Force
1075
+ Write-Host "Copied whisper.dll to build\bin\Release\whisper.dll directory"
1076
+
1077
+ Copy-Item -Path "ggml.dll" -Destination "build\bin\Release\ggml.dll" -Force
1078
+ Write-Host "Copied ggml.dll to build\bin\Release\ggml.dll directory"
1079
+
1080
+ Copy-Item -Path "ggml-base.dll" -Destination "build\bin\Release\ggml-base.dll" -Force
1081
+ Write-Host "Copied ggml-base.dll to build\bin\Release\ggml-base.dll directory"
1082
+
1083
+ Copy-Item -Path "ggml-cpu.dll" -Destination "build\bin\Release\ggml-cpu.dll" -Force
1084
+ Write-Host "Copied ggml-cpu.dll to build\bin\Release\ggml-cpu.dll directory"
1085
+
1086
+ Copy-Item -Path "SDL2.dll" -Destination "build\bin\Release\SDL2.dll" -Force
1087
+ Write-Host "Copied SDL2.dll to build\bin\Release\SDL2.dll directory"
1088
+
1089
+ - name : List build release files
1090
+ shell : pwsh
1091
+ run : |
1092
+ Get-ChildItem -Path "build\Release" -Recurse -Filter "*.dll"
1093
+
1094
+ - name : Build
1095
+ run : |
1096
+ models\download-ggml-model.cmd tiny.en models/
1097
+ cd bindings/java
1098
+ chmod +x ./gradlew
1099
+ ./gradlew build --info
1100
+
1101
+ - name : Upload jar
1102
+ uses : actions/upload-artifact@v4
1103
+ with :
1104
+ name : whispercpp.jar
1105
+ path : bindings/java/build/libs/whispercpp-*.jar
1106
+
1107
+ - name : Publish package
1108
+ if : ${{ github.ref == 'refs/heads/master' }}
1109
+ uses : gradle/gradle-build-action@v2.4.2
1110
+ with :
1111
+ arguments : publish
1112
+ build-root-directory : bindings/java
1113
+ env :
1114
+ MAVEN_USERNAME : ${{ secrets.JIRA_USER }}
1115
+ MAVEN_PASSWORD : ${{ secrets.JIRA_PASS }}
1116
+ PGP_SECRET : ${{ secrets.GPG_PRIVATE_KEY }}
1117
+ PGP_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
1042
1118
1043
1119
quantize :
1044
1120
if : ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
0 commit comments