Skip to content

Commit fb0a24f

Browse files
authored
ci : enable java package publishing (#1228)
1 parent 8e30bf3 commit fb0a24f

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
jobs:
88
ubuntu-latest:
99
runs-on: ubuntu-latest
10-
10+
1111
strategy:
1212
fail-fast: false
1313
matrix:
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- name: Clone
1818
uses: actions/checkout@v3
19-
19+
2020
- name: Set up QEMU
2121
uses: docker/setup-qemu-action@v2
2222

@@ -46,10 +46,10 @@ jobs:
4646
run: |
4747
make
4848
make stream
49-
49+
5050
freeBSD-latest:
5151
runs-on: macos-12
52-
52+
5353
steps:
5454
- name: Clone
5555
uses: actions/checkout@v3
@@ -131,10 +131,10 @@ jobs:
131131
steps:
132132
- name: Clone
133133
uses: actions/checkout@v3
134-
134+
135135
- name: Set up QEMU
136136
uses: docker/setup-qemu-action@v2
137-
137+
138138
- name: Build ${{ matrix.arch }}
139139
run: |
140140
docker run --platform ${{ matrix.arch }} --rm \
@@ -275,10 +275,10 @@ jobs:
275275
with:
276276
name: whisper-blas-bin-${{ matrix.arch }}
277277
path: build/bin/${{ matrix.build }}
278-
278+
279279
windows-cublas:
280280
runs-on: windows-latest
281-
281+
282282
strategy:
283283
matrix:
284284
build: [Release]
@@ -290,40 +290,40 @@ jobs:
290290
s2arc: x64
291291
- sdl2: ON
292292
s2ver: 2.26.0
293-
293+
294294
steps:
295295
- name: Clone
296296
uses: actions/checkout@v3
297297

298298
- name: Add msbuild to PATH
299299
uses: microsoft/setup-msbuild@v1
300-
300+
301301
- name: Install CUDA Toolkit
302302
id: cuda-toolkit
303303
uses: Jimver/[email protected]
304-
304+
305305
- name: Fetch SDL2 and set SDL2_DIR
306306
if: matrix.sdl2 == 'ON'
307307
run: |
308308
C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip
309309
7z x sdl2.zip
310310
echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV
311-
311+
312312
- name: Configure
313313
run: >
314314
cmake -S . -B ./build -A ${{ matrix.arch }}
315315
-DCMAKE_BUILD_TYPE=${{ matrix.build }}
316316
-DWHISPER_CUBLAS=1
317-
317+
318318
- name: Build
319319
run: |
320320
cd ./build
321321
msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }}
322-
322+
323323
- name: Copy SDL2.dll
324324
if: matrix.sdl2 == 'ON'
325325
run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}
326-
326+
327327
- name: Upload binaries
328328
if: matrix.sdl2 == 'ON'
329329
uses: actions/upload-artifact@v1
@@ -371,7 +371,7 @@ jobs:
371371
372372
- name: Build objc example
373373
run: xcodebuild -project examples/whisper.objc/whisper.objc.xcodeproj -scheme whisper.objc -configuration ${{ matrix.build }} -sdk iphonesimulator build
374-
374+
375375
- name: Build swiftui example
376376
run: xcodebuild -project examples/whisper.swiftui/whisper.swiftui.xcodeproj -scheme WhisperCppDemo -configuration ${{ matrix.build }} -sdk iphonesimulator build
377377

@@ -387,7 +387,7 @@ jobs:
387387
with:
388388
distribution: zulu
389389
java-version: 17
390-
390+
391391
- name: Setup Android SDK
392392
uses: android-actions/setup-android@v2
393393

@@ -426,6 +426,15 @@ jobs:
426426
name: whispercpp.jar
427427
path: bindings/java/build/libs/whispercpp-*.jar
428428

429+
- name: Publish package
430+
if: ${{ github.ref == 'refs/heads/master' }}
431+
uses: gradle/gradle-build-action@v2
432+
with:
433+
arguments: publish
434+
env:
435+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
436+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
437+
429438
quantize:
430439
runs-on: ubuntu-latest
431440

@@ -438,12 +447,3 @@ jobs:
438447
./models/download-ggml-model.sh tiny.en
439448
make quantize
440449
./quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
441-
442-
# - name: Publish package
443-
# if: ${{ github.ref == 'refs/heads/master' }}
444-
# uses: gradle/gradle-build-action@v2
445-
# with:
446-
# arguments: publish
447-
# env:
448-
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
449-
# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 commit comments

Comments
 (0)