Repository navigation
103 lines (83 loc) · 3.17 KB
/
Copy pathbuild-macos-libs.yml
File metadata and controls
103 lines (83 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build macOS bundled libs (GLFW + GLEW)
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build-arm64:
runs-on: macos-latest # arm64
steps:
- uses: actions/checkout@v4
- name: Install GLFW and GLEW
run: |
export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
brew install glfw glew
- name: Collect and fix dylib install names
run: |
mkdir -p libs/macos-arm64
GLFW=$(brew --prefix glfw)/lib/libglfw.3.dylib
cp "$GLFW" libs/macos-arm64/libglfw.3.dylib
install_name_tool -id @rpath/libglfw.3.dylib libs/macos-arm64/libglfw.3.dylib
GLEW_VER=$(ls $(brew --prefix glew)/lib/libGLEW.*.dylib | head -1)
GLEW_BASE=$(basename "$GLEW_VER")
cp "$GLEW_VER" libs/macos-arm64/$GLEW_BASE
install_name_tool -id @rpath/$GLEW_BASE libs/macos-arm64/$GLEW_BASE
cp "$GLEW_VER" libs/macos-arm64/libGLEW.dylib
install_name_tool -id @rpath/libGLEW.dylib libs/macos-arm64/libGLEW.dylib
echo "=== arm64 libs ==="
file libs/macos-arm64/*.dylib
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-arm64-libs
path: libs/macos-arm64/
build-x64:
runs-on: macos-13 # last Intel runner
steps:
- uses: actions/checkout@v4
- name: Install GLFW and GLEW
run: |
export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
export NONINTERACTIVE=1
brew untap aws/tap 2>/dev/null || true
brew install --quiet glfw glew
timeout-minutes: 15
- name: Collect and fix dylib install names
run: |
mkdir -p libs/macos-x64
GLFW=$(brew --prefix glfw)/lib/libglfw.3.dylib
cp "$GLFW" libs/macos-x64/libglfw.3.dylib
install_name_tool -id @rpath/libglfw.3.dylib libs/macos-x64/libglfw.3.dylib
GLEW_VER=$(ls $(brew --prefix glew)/lib/libGLEW.*.dylib | head -1)
GLEW_BASE=$(basename "$GLEW_VER")
cp "$GLEW_VER" libs/macos-x64/$GLEW_BASE
install_name_tool -id @rpath/$GLEW_BASE libs/macos-x64/$GLEW_BASE
cp "$GLEW_VER" libs/macos-x64/libGLEW.dylib
install_name_tool -id @rpath/libGLEW.dylib libs/macos-x64/libGLEW.dylib
echo "=== x64 libs ==="
file libs/macos-x64/*.dylib
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-x64-libs
path: libs/macos-x64/
commit:
needs: [build-arm64, build-x64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: macos-arm64-libs
path: libs/macos-arm64/
- uses: actions/download-artifact@v4
with:
name: macos-x64-libs
path: libs/macos-x64/
- name: Commit to repo
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add libs/macos-arm64/ libs/macos-x64/
git diff --staged --quiet || git commit -m "ci: update bundled macOS arm64+x64 GLFW+GLEW dylibs"
git push