Add GitHub Actions workflow for iOS build #7
This file contains 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 iOS App | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install SDL2 | |
run: | | |
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf | |
- name: Verify SDL2 Installation Path | |
run: | | |
echo "SDL2 path:" $(brew --prefix sdl2) | |
ls /opt/homebrew/opt/sdl2/include/SDL2 | |
- name: Compile the iOS App | |
run: | | |
mkdir -p build | |
SDK_PATH=$(xcrun --sdk iphoneos --show-sdk-path) | |
clang -v -o build/MyIOSApp main.c \ | |
-I/opt/homebrew/opt/sdl2/include \ | |
-L/opt/homebrew/opt/sdl2/lib \ | |
-lSDL2 \ | |
-framework UIKit \ | |
-framework Foundation \ | |
-framework CoreGraphics \ | |
-isysroot $SDK_PATH \ | |
-arch arm64 | |
- name: Upload the build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ios-app | |
path: build/MyIOSApp |