@@ -12,6 +12,11 @@ permissions:
1212 contents : write
1313 packages : write
1414
15+ env :
16+ OPUS_REPOSITORY : https://gitlab.xiph.org/xiph/opus.git
17+ OPUS_VERSION : 1.6.1
18+ OPUS_REF : v1.6.1
19+
1520jobs :
1621 Android :
1722 runs-on : ubuntu-latest
2227 arch : [x64, x86, arm64, arm32]
2328 fail-fast : false
2429 steps :
25- - uses : actions/checkout@v4
26- - uses : nttld/setup-ndk@v1
30+ - uses : actions/checkout@v6.0.2
31+ - uses : nttld/setup-ndk@v1.6.0
2732 id : setup-ndk
2833 with :
2934 ndk-version : r28c
4853 run : mkdir build
4954
5055 - name : Clone Repository
51- run : git clone https://github.com/xiph/opus.git
56+ run : git clone --branch ${{ env.OPUS_REF }} --depth 1 ${{ env.OPUS_REPOSITORY }} opus
5257
5358 - name : Autogen
5459 run : ./opus/autogen.sh
@@ -71,15 +76,16 @@ jobs:
7176 -I../opus/include \
7277 ../OpusSharp.Natives/opus_shim.c \
7378 -Wl,--whole-archive libopus.a -Wl,--no-whole-archive \
74- -Wl,-z,max-page-size=16384,-z,common-page-size=16384
79+ -Wl,-z,max-page-size=16384,-z,common-page-size=16384 \
80+ -lm
7581
7682 - name : Check Alignment
7783 if : ${{ env.CHECK_ALIGNMENT == 'true' }}
7884 working-directory : ./build
7985 run : sudo apt install llvm && llvm-objdump -p libopus.so | grep LOAD
8086
8187 - name : Upload Artifact
82- uses : actions/upload-artifact@v4
88+ uses : actions/upload-artifact@v7.0.1
8389 with :
8490 name : android-${{ matrix.arch }}-libopus.so
8591 path : ./build/libopus.so
9197 arch : [x64, x86, arm64, arm32]
9298 fail-fast : false
9399 steps :
94- - uses : actions/checkout@v4
100+ - uses : actions/checkout@v6.0.2
95101
96102 # Not much I can do to reduce the bloat.
97103 - name : Setup Environment
@@ -120,7 +126,7 @@ jobs:
120126 run : mkdir build
121127
122128 - name : Clone Repository
123- run : git clone https://github.com/xiph/opus.git
129+ run : git clone --branch ${{ env.OPUS_REF }} --depth 1 ${{ env.OPUS_REPOSITORY }} opus
124130
125131 - name : Autogen
126132 run : ./opus/autogen.sh
@@ -157,7 +163,7 @@ jobs:
157163 -lm
158164
159165 - name : Upload Artifact
160- uses : actions/upload-artifact@v4
166+ uses : actions/upload-artifact@v7.0.1
161167 with :
162168 name : linux-${{ matrix.arch }}-opus.so
163169 path : ./build/opus.so
@@ -169,7 +175,7 @@ jobs:
169175 arch : [x64, x86, arm64] # Disabled arm32
170176 fail-fast : false
171177 steps :
172- - uses : actions/checkout@v4
178+ - uses : actions/checkout@v6.0.2
173179
174180 # Not much I can do to reduce the bloat.
175181 - name : Setup Environment
@@ -188,7 +194,7 @@ jobs:
188194 run : mkdir build
189195
190196 - name : Clone Repository
191- run : git clone https://github.com/xiph/opus.git
197+ run : git clone --branch ${{ env.OPUS_REF }} --depth 1 ${{ env.OPUS_REPOSITORY }} opus
192198
193199 - name : Autogen
194200 run : ./opus/autogen.bat
@@ -214,10 +220,12 @@ jobs:
214220 if "${{ env.ARCH }}"=="Win32" (set "VCARCH=x86") else if "${{ env.ARCH }}"=="x64" (set "VCARCH=amd64") else if "${{ env.ARCH }}"=="ARM64" (set "VCARCH=amd64_arm64") else if "${{ env.ARCH }}"=="ARM" (set "VCARCH=amd64_arm")
215221 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %VCARCH%
216222 cl /O2 /MD /I..\opus\include /c ..\OpusSharp.Natives\opus_shim.c /Foopus_shim.obj
217- link /DLL /OUT:opus.dll opus_shim.obj Release\opus.lib ucrt.lib vcruntime.lib msvcrt.lib
223+ dumpbin /symbols Release\opus.lib > opus_symbols.txt
224+ powershell -NoProfile -Command "$s = (gc opus_symbols.txt) | Where-Object {$_ -match 'External\s+\|\s+(opus_\S+)'} | ForEach-Object { [regex]::Match($_, 'External\s+\|\s+(\S+)').Groups[1].Value -replace '^_','' } | Sort-Object -Unique; [IO.File]::WriteAllText('opus.def', \"EXPORTS`r`n\" + ($s -join \"`r`n\") + \"`r`n\")"
225+ link /DLL /OUT:opus.dll /DEF:opus.def opus_shim.obj Release\opus.lib ucrt.lib vcruntime.lib msvcrt.lib
218226
219227 - name : Upload Artifact
220- uses : actions/upload-artifact@v4
228+ uses : actions/upload-artifact@v7.0.1
221229 with :
222230 name : win-${{ matrix.arch }}-opus.dll
223231 path : ./build/opus.dll
@@ -229,7 +237,7 @@ jobs:
229237 arch : [x64, arm64]
230238 fail-fast : false
231239 steps :
232- - uses : actions/checkout@v4
240+ - uses : actions/checkout@v6.0.2
233241
234242 # Not much I can do to reduce the bloat.
235243 - name : Setup Environment
@@ -245,7 +253,7 @@ jobs:
245253 run : mkdir build
246254
247255 - name : Clone Repository
248- run : git clone https://github.com/xiph/opus.git
256+ run : git clone --branch ${{ env.OPUS_REF }} --depth 1 ${{ env.OPUS_REPOSITORY }} opus
249257
250258 - name : Autogen
251259 run : ./opus/autogen.sh
@@ -268,7 +276,7 @@ jobs:
268276 -install_name @rpath/opus.dylib
269277
270278 - name : Upload Artifact
271- uses : actions/upload-artifact@v4
279+ uses : actions/upload-artifact@v7.0.1
272280 with :
273281 name : macos-${{ matrix.arch }}-opus.dylib
274282 path : ./build/opus.dylib
@@ -280,7 +288,7 @@ jobs:
280288 target : [device, simulator-arm64, simulator-x86_64]
281289 fail-fast : false
282290 steps :
283- - uses : actions/checkout@v4
291+ - uses : actions/checkout@v6.0.2
284292
285293 - name : Setup Environment
286294 run : |
@@ -303,15 +311,13 @@ jobs:
303311 run : mkdir build
304312
305313 - name : Clone Repository
306- run : git clone https://github.com/xiph/opus.git
314+ run : git clone --branch ${{ env.OPUS_REF }} --depth 1 ${{ env.OPUS_REPOSITORY }} opus
307315
308316 - name : Generate Build Scripts
309317 run : |
310318 export PATH="/opt/homebrew/bin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
311319 cd ./opus
312- git fetch --tags --force
313- OPUS_VERSION="$(git describe --tags --always --match 'v*' | sed 's/^v//')"
314- echo "PACKAGE_VERSION=\"$OPUS_VERSION\"" > package_version
320+ echo "PACKAGE_VERSION=\"${{ env.OPUS_VERSION }}\"" > package_version
315321 autoreconf -isf
316322
317323 - name : Build Static Library
@@ -405,7 +411,7 @@ jobs:
405411
406412
407413 - name : Upload Artifact
408- uses : actions/upload-artifact@v4
414+ uses : actions/upload-artifact@v7.0.1
409415 with :
410416 name : ${{ env.OUTPUT_NAME }}-libopus.a
411417 path : ./build/.libs/libopus.a
@@ -414,25 +420,25 @@ jobs:
414420 runs-on : macos-latest
415421 needs : iOS
416422 steps :
417- - uses : actions/checkout@v4
423+ - uses : actions/checkout@v6.0.2
418424
419425 - name : Clone opus for headers
420- run : git clone --depth 1 https://github.com/xiph/ opus.git
426+ run : git clone --branch ${{ env.OPUS_REF }} -- depth 1 ${{ env.OPUS_REPOSITORY }} opus
421427
422428 - name : Download device artifact
423- uses : actions/download-artifact@v4
429+ uses : actions/download-artifact@v8.0.1
424430 with :
425431 name : ios-device-arm64-libopus.a
426432 path : device
427433
428434 - name : Download simulator-arm64 artifact
429- uses : actions/download-artifact@v4
435+ uses : actions/download-artifact@v8.0.1
430436 with :
431437 name : ios-simulator-arm64-libopus.a
432438 path : sim_arm64
433439
434440 - name : Download simulator-x86_64 artifact
435- uses : actions/download-artifact@v4
441+ uses : actions/download-artifact@v8.0.1
436442 with :
437443 name : ios-simulator-x86_64-libopus.a
438444 path : sim_x86
@@ -468,22 +474,22 @@ jobs:
468474 ls -laR universal/
469475
470476 - name : Upload Universal Artifact
471- uses : actions/upload-artifact@v4
477+ uses : actions/upload-artifact@v7.0.1
472478 with :
473479 name : ios-universal-libopus
474480 path : universal/*
475481
476482 Wasm :
477483 runs-on : ubuntu-latest
478484 steps :
479- - uses : actions/checkout@v4
480- - uses : mymindstorm/setup-emsdk@v14
485+ - uses : actions/checkout@v6.0.2
486+ - uses : mymindstorm/setup-emsdk@v16
481487
482488 - name : Create Build Dir
483489 run : mkdir build
484490
485491 - name : Clone Repository
486- run : git clone https://github.com/xiph/opus.git
492+ run : git clone --branch ${{ env.OPUS_REF }} --depth 1 ${{ env.OPUS_REPOSITORY }} opus
487493
488494 - name : Autogen
489495 run : ./opus/autogen.sh
@@ -503,7 +509,7 @@ jobs:
503509 emar rcs libopus.a opus_shim.o
504510
505511 - name : Upload Artifact
506- uses : actions/upload-artifact@v4
512+ uses : actions/upload-artifact@v7.0.1
507513 with :
508514 name : wasm-libopus.a
509515 path : ./build/libopus.a
@@ -512,99 +518,106 @@ jobs:
512518 runs-on : ubuntu-latest
513519 needs : [Android, iOS-universal, MacOS, Linux, Windows, Wasm]
514520 steps :
515- - uses : actions/checkout@v4
521+ - uses : actions/checkout@v6.0.2
516522
517523 # Android
518524 - name : Download android-arm32-libopus.so
519- uses : actions/download-artifact@v4
525+ uses : actions/download-artifact@v8.0.1
520526 with :
521527 name : android-arm32-libopus.so
522528 path : runtimes/android-arm/native
523529
524530 - name : Download android-arm64-libopus.so
525- uses : actions/download-artifact@v4
531+ uses : actions/download-artifact@v8.0.1
526532 with :
527533 name : android-arm64-libopus.so
528534 path : runtimes/android-arm64/native
529535
530536 - name : Download android-x64-libopus.so
531- uses : actions/download-artifact@v4
537+ uses : actions/download-artifact@v8.0.1
532538 with :
533539 name : android-x64-libopus.so
534540 path : runtimes/android-x64/native
535541
536542 - name : Download android-x86-libopus.so
537- uses : actions/download-artifact@v4
543+ uses : actions/download-artifact@v8.0.1
538544 with :
539545 name : android-x86-libopus.so
540546 path : runtimes/android-x86/native
541547
542548 # iOS
543549 - name : Download ios-universal-libopus
544- uses : actions/download-artifact@v4
550+ uses : actions/download-artifact@v8.0.1
545551 with :
546552 name : ios-universal-libopus
547553 path : runtimes/ios/native
548554
549555 # Linux
550556 - name : Download linux-arm32-opus.so
551- uses : actions/download-artifact@v4
557+ uses : actions/download-artifact@v8.0.1
552558 with :
553559 name : linux-arm32-opus.so
554560 path : runtimes/linux-arm/native
555561
556562 - name : Download linux-arm64-opus.so
557- uses : actions/download-artifact@v4
563+ uses : actions/download-artifact@v8.0.1
558564 with :
559565 name : linux-arm64-opus.so
560566 path : runtimes/linux-arm64/native
561567
562568 - name : Download linux-x64-opus.so
563- uses : actions/download-artifact@v4
569+ uses : actions/download-artifact@v8.0.1
564570 with :
565571 name : linux-x64-opus.so
566572 path : runtimes/linux-x64/native
567573
568574 - name : Download linux-x86-opus.so
569- uses : actions/download-artifact@v4
575+ uses : actions/download-artifact@v8.0.1
570576 with :
571577 name : linux-x86-opus.so
572578 path : runtimes/linux-x86/native
573579
574580 # MacOS
575581 - name : Download macos-arm64-opus.dylib
576- uses : actions/download-artifact@v4
582+ uses : actions/download-artifact@v8.0.1
577583 with :
578584 name : macos-arm64-opus.dylib
579585 path : runtimes/osx-arm64/native
580586
581587 - name : Download macos-x64-opus.dylib
582- uses : actions/download-artifact@v4
588+ uses : actions/download-artifact@v8.0.1
583589 with :
584590 name : macos-x64-opus.dylib
585591 path : runtimes/osx-x64/native
586592
587593 # Windows
588594 - name : Download win-arm64-opus.dll
589- uses : actions/download-artifact@v4
595+ uses : actions/download-artifact@v8.0.1
590596 with :
591597 name : win-arm64-opus.dll
592598 path : runtimes/win-arm64/native
593599
594600 - name : Download win-x64-opus.dll
595- uses : actions/download-artifact@v4
601+ uses : actions/download-artifact@v8.0.1
596602 with :
597603 name : win-x64-opus.dll
598604 path : runtimes/win-x64/native
599605
600606 - name : Download win-x86-opus.dll
601- uses : actions/download-artifact@v4
607+ uses : actions/download-artifact@v8.0.1
602608 with :
603609 name : win-x86-opus.dll
604610 path : runtimes/win-x86/native
611+
612+ # WASM
613+ - name : Download wasm-libopus.a
614+ uses : actions/download-artifact@v8.0.1
615+ with :
616+ name : wasm-libopus.a
617+ path : runtimes/browser-wasm/native
605618
606619 - name : Upload Artifact
607- uses : actions/upload-artifact@v4
620+ uses : actions/upload-artifact@v7.0.1
608621 with :
609622 name : All-Runtimes
610- path : ./runtimes
623+ path : ./runtimes
0 commit comments