|
1 | 1 | name: Build macOS bundled dylibs |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: # manual trigger only |
| 4 | + workflow_dispatch: |
5 | 5 |
|
6 | 6 | jobs: |
7 | | - build: |
| 7 | + build-arm64: |
8 | 8 | runs-on: macos-latest |
9 | 9 | steps: |
10 | 10 | - uses: actions/checkout@v4 |
11 | | - |
12 | | - - name: Install GLFW and GLEW via Homebrew |
13 | | - run: brew install glfw glew |
14 | | - |
15 | | - - name: Collect dylibs (arm64) |
| 11 | + - name: Install GLFW and GLEW |
| 12 | + run: | |
| 13 | + export HOMEBREW_NO_REQUIRE_TAP_TRUST=1 |
| 14 | + brew install glfw glew |
| 15 | + - name: Collect arm64 dylibs |
16 | 16 | run: | |
17 | 17 | mkdir -p libs/macos-arm64 |
18 | | - # GLFW |
19 | 18 | cp $(brew --prefix glfw)/lib/libglfw.3.dylib libs/macos-arm64/ |
20 | | - # GLEW |
21 | 19 | cp $(brew --prefix glew)/lib/libGLEW.dylib libs/macos-arm64/ |
22 | | - # Fix install names so the binary finds them via @rpath |
23 | 20 | install_name_tool -id @rpath/libglfw.3.dylib libs/macos-arm64/libglfw.3.dylib |
24 | 21 | install_name_tool -id @rpath/libGLEW.dylib libs/macos-arm64/libGLEW.dylib |
25 | | - ls -la libs/macos-arm64/ |
26 | 22 | file libs/macos-arm64/*.dylib |
| 23 | + - uses: actions/upload-artifact@v4 |
| 24 | + with: |
| 25 | + name: macos-arm64-dylibs |
| 26 | + path: libs/macos-arm64/ |
| 27 | + retention-days: 30 |
27 | 28 |
|
28 | | - - name: Also build x64 slice (lipo from universal if available) |
| 29 | + build-x64: |
| 30 | + runs-on: macos-13 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - name: Install GLFW and GLEW |
| 34 | + run: | |
| 35 | + export HOMEBREW_NO_REQUIRE_TAP_TRUST=1 |
| 36 | + brew install glfw glew |
| 37 | + - name: Collect x64 dylibs |
29 | 38 | run: | |
30 | 39 | mkdir -p libs/macos-x64 |
31 | | - # GitHub's macos-latest runners are arm64; extract x86_64 slice if universal |
32 | | - for f in libs/macos-arm64/*.dylib; do |
33 | | - name=$(basename $f) |
34 | | - if lipo -info $f 2>/dev/null | grep -q x86_64; then |
35 | | - lipo $f -thin x86_64 -output libs/macos-x64/$name |
36 | | - else |
37 | | - # arm64 only -- copy as-is for now, x64 users need Homebrew |
38 | | - cp $f libs/macos-x64/$name |
39 | | - fi |
40 | | - done |
41 | | - ls -la libs/macos-x64/ |
| 40 | + cp $(brew --prefix glfw)/lib/libglfw.3.dylib libs/macos-x64/ |
| 41 | + cp $(brew --prefix glew)/lib/libGLEW.dylib libs/macos-x64/ |
| 42 | + install_name_tool -id @rpath/libglfw.3.dylib libs/macos-x64/libglfw.3.dylib |
| 43 | + install_name_tool -id @rpath/libGLEW.dylib libs/macos-x64/libGLEW.dylib |
42 | 44 | file libs/macos-x64/*.dylib |
43 | | -
|
44 | | - - name: Upload as artifact |
45 | | - uses: actions/upload-artifact@v4 |
| 45 | + - uses: actions/upload-artifact@v4 |
46 | 46 | with: |
47 | | - name: macos-dylibs |
48 | | - path: | |
49 | | - libs/macos-arm64/ |
50 | | - libs/macos-x64/ |
| 47 | + name: macos-x64-dylibs |
| 48 | + path: libs/macos-x64/ |
51 | 49 | retention-days: 30 |
0 commit comments