Build macOS bundled dylibs #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build macOS bundled libs (GLFW + GLEW) | |
| on: | |
| workflow_dispatch: # manual trigger only | |
| jobs: | |
| build: | |
| runs-on: macos-latest # arm64 runner | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install GLFW and GLEW via Homebrew | |
| run: brew install glfw glew | |
| - name: Collect and fix dylib install names | |
| run: | | |
| mkdir -p libs/macos-arm64 | |
| # GLFW | |
| 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 | |
| GLEW=$(brew --prefix glew)/lib/libGLEW.dylib | |
| # Get actual versioned name | |
| 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 | |
| # Also create libGLEW.dylib symlink-equivalent copy | |
| 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 | |
| otool -L libs/macos-arm64/libglfw.3.dylib | |
| otool -L libs/macos-arm64/libGLEW.dylib | |
| - name: Upload as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-arm64-libs | |
| path: libs/macos-arm64/ | |
| - 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/ | |
| git diff --staged --quiet || git commit -m "ci: add bundled macOS arm64 GLFW+GLEW dylibs" | |
| git push |