|
5 | 5 | branches: |
6 | 6 | - main |
7 | 7 |
|
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + pull-requests: write |
| 11 | + |
8 | 12 | jobs: |
9 | 13 | build-mac: |
10 | 14 | if: startsWith(github.ref, 'refs/heads/ci/prebuilt-') == false |
11 | 15 | runs-on: macos-latest |
12 | 16 | steps: |
13 | 17 | - uses: actions/checkout@v4 |
14 | 18 | with: |
15 | | - submodules: recursive |
16 | 19 | fetch-depth: 0 |
17 | 20 | - uses: actions/setup-node@v4 |
18 | 21 | with: |
19 | 22 | node-version: '22' |
20 | | - - name: Initialize submodules |
| 23 | + - name: Install system libraries (OpenSSL, Opus, libsrtp) |
| 24 | + if: runner.os == 'macOS' |
| 25 | + run: | |
| 26 | + brew update |
| 27 | + brew install openssl@3 opus libsrtp pkg-config ninja cmake |
| 28 | + - name: Clone dependencies (no submodules) |
| 29 | + shell: bash |
21 | 30 | run: | |
22 | | - git submodule sync --recursive |
23 | | - git submodule update --init --recursive |
| 31 | + set -euo pipefail |
| 32 | + mkdir -p deps |
| 33 | + if [[ ! -d deps/re ]]; then git clone --depth=1 https://github.com/baresip/re.git deps/re; fi |
| 34 | + if [[ ! -d deps/baresip ]]; then git clone --depth=1 https://github.com/baresip/baresip.git deps/baresip; fi |
24 | 35 | - name: Install Node dependencies |
25 | 36 | run: npm ci |
26 | 37 | - name: Build libre (re) static and stage SDK |
27 | 38 | shell: bash |
28 | 39 | run: | |
29 | 40 | set -euo pipefail |
30 | 41 | ROOT="$GITHUB_WORKSPACE" |
| 42 | + OPENSSL_PREFIX=$(brew --prefix openssl@3 || echo "/opt/homebrew/opt/openssl@3") |
31 | 43 | cd "$ROOT/deps/re" |
32 | 44 | rm -rf build |
33 | | - cmake -B build -DCMAKE_BUILD_TYPE=Release |
| 45 | + cmake -B build -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="$OPENSSL_PREFIX" |
34 | 46 | cmake --build build -j |
35 | 47 | mkdir -p "$ROOT/local/re/lib" "$ROOT/local/re/include" |
36 | 48 | if [[ -f build/libre.a ]]; then cp -a build/libre.a "$ROOT/local/re/lib/"; \ |
|
42 | 54 | run: | |
43 | 55 | set -euo pipefail |
44 | 56 | ROOT="$GITHUB_WORKSPACE" |
| 57 | + OPENSSL_PREFIX=$(brew --prefix openssl@3 || echo "/opt/homebrew/opt/openssl@3") |
45 | 58 | cd "$ROOT/deps/baresip" |
46 | 59 | rm -rf build |
47 | | - cmake -B build -DSTATIC=ON -DCMAKE_BUILD_TYPE=Release |
| 60 | + cmake -B build -DSTATIC=ON -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="$OPENSSL_PREFIX" |
48 | 61 | cmake --build build -j |
49 | 62 | mkdir -p "$ROOT/local/baresip/lib" "$ROOT/local/baresip/include" |
50 | 63 | if [[ -f build/libbaresip.a ]]; then cp -a build/libbaresip.a "$ROOT/local/baresip/lib/"; \ |
|
0 commit comments