Skip to content

Commit 4bb6603

Browse files
committed
ci: add Intel x64 macOS build, split into parallel jobs
1 parent 0da4e86 commit 4bb6603

1 file changed

Lines changed: 55 additions & 15 deletions

File tree

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,96 @@
11
name: Build macOS bundled libs (GLFW + GLEW)
22

33
on:
4-
workflow_dispatch: # manual trigger only
4+
workflow_dispatch:
55

66
permissions:
77
contents: write
88

99
jobs:
10-
build:
11-
runs-on: macos-latest # arm64 runner
12-
10+
build-arm64:
11+
runs-on: macos-latest # arm64
1312
steps:
1413
- uses: actions/checkout@v4
1514

16-
- name: Install GLFW and GLEW via Homebrew
15+
- name: Install GLFW and GLEW
1716
run: brew install glfw glew
1817

1918
- name: Collect and fix dylib install names
2019
run: |
2120
mkdir -p libs/macos-arm64
2221
23-
# GLFW
2422
GLFW=$(brew --prefix glfw)/lib/libglfw.3.dylib
2523
cp "$GLFW" libs/macos-arm64/libglfw.3.dylib
2624
install_name_tool -id @rpath/libglfw.3.dylib libs/macos-arm64/libglfw.3.dylib
2725
28-
# GLEW
29-
GLEW=$(brew --prefix glew)/lib/libGLEW.dylib
30-
# Get actual versioned name
3126
GLEW_VER=$(ls $(brew --prefix glew)/lib/libGLEW.*.dylib | head -1)
3227
GLEW_BASE=$(basename "$GLEW_VER")
3328
cp "$GLEW_VER" libs/macos-arm64/$GLEW_BASE
3429
install_name_tool -id @rpath/$GLEW_BASE libs/macos-arm64/$GLEW_BASE
35-
# Also create libGLEW.dylib symlink-equivalent copy
3630
cp "$GLEW_VER" libs/macos-arm64/libGLEW.dylib
3731
install_name_tool -id @rpath/libGLEW.dylib libs/macos-arm64/libGLEW.dylib
3832
3933
echo "=== arm64 libs ==="
4034
file libs/macos-arm64/*.dylib
41-
otool -L libs/macos-arm64/libglfw.3.dylib
42-
otool -L libs/macos-arm64/libGLEW.dylib
4335
44-
- name: Upload as artifact
36+
- name: Upload artifact
4537
uses: actions/upload-artifact@v4
4638
with:
4739
name: macos-arm64-libs
4840
path: libs/macos-arm64/
4941

42+
build-x64:
43+
runs-on: macos-13 # last Intel runner
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install GLFW and GLEW
48+
run: brew install glfw glew
49+
50+
- name: Collect and fix dylib install names
51+
run: |
52+
mkdir -p libs/macos-x64
53+
54+
GLFW=$(brew --prefix glfw)/lib/libglfw.3.dylib
55+
cp "$GLFW" libs/macos-x64/libglfw.3.dylib
56+
install_name_tool -id @rpath/libglfw.3.dylib libs/macos-x64/libglfw.3.dylib
57+
58+
GLEW_VER=$(ls $(brew --prefix glew)/lib/libGLEW.*.dylib | head -1)
59+
GLEW_BASE=$(basename "$GLEW_VER")
60+
cp "$GLEW_VER" libs/macos-x64/$GLEW_BASE
61+
install_name_tool -id @rpath/$GLEW_BASE libs/macos-x64/$GLEW_BASE
62+
cp "$GLEW_VER" libs/macos-x64/libGLEW.dylib
63+
install_name_tool -id @rpath/libGLEW.dylib libs/macos-x64/libGLEW.dylib
64+
65+
echo "=== x64 libs ==="
66+
file libs/macos-x64/*.dylib
67+
68+
- name: Upload artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: macos-x64-libs
72+
path: libs/macos-x64/
73+
74+
commit:
75+
needs: [build-arm64, build-x64]
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
80+
- uses: actions/download-artifact@v4
81+
with:
82+
name: macos-arm64-libs
83+
path: libs/macos-arm64/
84+
85+
- uses: actions/download-artifact@v4
86+
with:
87+
name: macos-x64-libs
88+
path: libs/macos-x64/
89+
5090
- name: Commit to repo
5191
run: |
5292
git config user.name "github-actions[bot]"
5393
git config user.email "github-actions[bot]@users.noreply.github.com"
54-
git add libs/macos-arm64/
55-
git diff --staged --quiet || git commit -m "ci: add bundled macOS arm64 GLFW+GLEW dylibs"
94+
git add libs/macos-arm64/ libs/macos-x64/
95+
git diff --staged --quiet || git commit -m "ci: update bundled macOS arm64+x64 GLFW+GLEW dylibs"
5696
git push

0 commit comments

Comments
 (0)