diff --git a/.github/workflows/ios-release.yml b/.github/workflows/ios-release.yml index d1a395c..d4bbc75 100644 --- a/.github/workflows/ios-release.yml +++ b/.github/workflows/ios-release.yml @@ -1,4 +1,4 @@ -name: iOS +name: iOS Release on: push: @@ -16,9 +16,14 @@ on: - "major" jobs: - build-release: + build: runs-on: macos-14 - timeout-minutes: 120 + strategy: + matrix: + arch: ["arm64-ios", "arm64-ios-simulator", "x64-ios-simulator"] + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-ios-build-${{ matrix.arch }} + cancel-in-progress: true steps: - name: Checkout Valhalla @@ -26,8 +31,52 @@ jobs: with: submodules: "recursive" + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "14.3.1" + + - name: Setup VCPKG + run: | + git clone https://github.com/microsoft/vcpkg && git -C vcpkg checkout 2024.09.23 + ./vcpkg/bootstrap-vcpkg.sh + export VCPKG_ROOT=`pwd`/vcpkg + - name: Build for iOS & iOS Simulator - run: ./build.sh ios clean + run: ./build.sh --ios ${{ matrix.arch }} + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.arch }} + path: | + build/apple/${{ matrix.arch }}/install + + create-xcframework-release: + needs: build + runs-on: macos-14 + steps: + - name: Checkout Valhalla + uses: actions/checkout@v4 + + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "14.3.1" + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: build/apple + + - name: Move artifacts to correct locations + run: | + for arch in arm64-ios arm64-ios-simulator x64-ios-simulator; do + mkdir -p build/apple/$arch/install + mv build/apple/$arch/* build/apple/$arch/install/ || true + done + + - name: Create XCFramework + run: | + ./scripts/create_xcframework.sh - name: Zip the xcframework run: | @@ -45,7 +94,7 @@ jobs: draft-release: runs-on: macos-14 - needs: build-release + needs: create-xcframework-release outputs: version: ${{ steps.version.outputs.version }} release_id: ${{ steps.release.outputs.id }}