Skip to content

initial M1 build test #179

initial M1 build test

initial M1 build test #179

Workflow file for this run

name: Build ios
on:
push:
paths-ignore:
- '.github/workflows/android.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/mac.yml'
- '.github/workflows/win.yml'
- 'vcpkg-overlay/triplets/arm-android.yml'
- 'vcpkg-overlay/triplets/arm64-android.yml'
- 'vcpkg-overlay/triplets/arm64-osx.yml'
- 'vcpkg-overlay/triplets/x64-linux.yml'
- 'vcpkg-overlay/triplets/x64-osx.yml'
- 'vcpkg-overlay/triplets/x64-windows.yml'
- 'scripts/**'
- 'LICENSE'
- 'README.md'
concurrency:
group: ci-${{github.ref}}-ios
cancel-in-progress: true
jobs:
ios_build:
runs-on: macos-14
env: # update README for devs if you modify these env. variables
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
TRIPLET: "arm64-ios"
DEPLOYMENT_TARGET: '13.0' # iOS Deployment target
XC_VERSION: ${{ '15.3' }}
QT_ARCH: "ios"
CMAKE_VERSION: '3.29.0'
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
steps:
- uses: actions/checkout@v3
with:
path: input-sdk
- name: Select latest Xcode
run: |
ls -1 /Applications | grep "Xcode"
sudo xcode-select -s "/Applications/Xcode_$XC_VERSION.app"
- name: Prepare vars
id: vars
run: |
brew install automake bison flex gnu-sed autoconf-archive libtool gettext
echo $(brew --prefix bison)/bin >> $GITHUB_PATH
echo $(brew --prefix flex)/bin >> $GITHUB_PATH
echo $(brew --prefix gettext)/bin >> $GITHUB_PATH
pip3 install -U pip
pip3 install aqtinstall
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}
- name: Restore cached Qt
id: cache-qt-restore
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/Qt
key: ${{ runner.os }}-QtCache-v20-${{ env.QT_VERSION }}-ios
- name: Install Qt
if: steps.cache-qt-restore.outputs.cache-hit != 'true'
run: |
python3 -m aqt install-qt \
mac ios ${{ env.QT_VERSION }} \
-m qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools \
-O ${{ github.workspace }}/Qt
python3 -m aqt install-qt \
mac desktop ${{ env.QT_VERSION }} \
-m qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools \
-O ${{ github.workspace }}/Qt
- name: Save Qt cache
uses: actions/cache/save@v3
if: steps.cache-qt-restore.outputs.cache-hit != 'true'
id: cache-qt-save
with:
path: ${{ github.workspace }}/Qt
key: ${{ steps.cache-qt-restore.outputs.cache-primary-key }}
- name: Get vcpkg
shell: bash
run: |
mkdir -p "${{ env.VCPKG_ROOT }}"
cd "${{ env.VCPKG_ROOT }}"
git init
git remote add origin https://github.com/microsoft/vcpkg.git
git pull origin master
VCPKG_TAG=`cat ${{ github.workspace }}/input-sdk/VCPKG_BASELINE`
echo "using VCPKG_TAG ${VCPKG_TAG}"
git checkout ${VCPKG_TAG}
- name: Install vcpkg
run: |
echo "install vcpkg"
cd "${{ env.VCPKG_ROOT }}"
chmod +x ./bootstrap-vcpkg.sh
./bootstrap-vcpkg.sh
- name: Build Deps
run: |
mkdir -p ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
export Qt6_DIR=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/ios
export QT_HOST_PATH=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos
export PATH=${{ env.VCPKG_ROOT }}:$PATH
vcpkg --version
cmake --version
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }}/input-sdk \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
-G Xcode \
-DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} \
-DVCPKG_OVERLAY_TRIPLETS:PATH="${{ github.workspace }}/input-sdk/vcpkg-overlay/triplets" \
-DVCPKG_OVERLAY_PORTS="${{ github.workspace }}/input-sdk/vcpkg-overlay/ports" \
-D CMAKE_SYSTEM_NAME=iOS \
-D CMAKE_SYSTEM_PROCESSOR=aarch64 \
-D CMAKE_OSX_DEPLOYMENT_TARGET=${{ env.DEPLOYMENT_TARGET }} \
-D ENABLE_BITCODE=OFF \
-D ENABLE_ARC=OFF \
-D CMAKE_CXX_VISIBILITY_PRESET=hidden
- name: Upload build logs on deps failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: build-logs-${{ env.TRIPLET }}
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Build Test App
run: |
cd ${{ github.workspace }}/build
cmake --build . --config Release --verbose
- name: Get TimeStamp
id: time
uses: nanzm/get-time-action@v2.0
with:
timeZone: 8
format: 'YYYYMMDD'
- name: Create SDK data folder
run: |
mkdir -p ${{ github.workspace }}/sdk
cp -R ${{ github.workspace }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ github.workspace }}/sdk/
rm -rf ${{ github.workspace }}/sdk/debug
rm -rf ${{ github.workspace }}/sdk/etc
rm -rf ${{ github.workspace }}/sdk/mkspecs
rm -rf ${{ github.workspace }}/sdk/share
rm -rf ${{ github.workspace }}/sdk/tools
SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV
cd ${{ github.workspace }}/sdk/
tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./
- name: Upload Sdk in Artifacts
uses: actions/upload-artifact@v3
with:
name: sdk-${{ env.TRIPLET }}
path: ${{ github.workspace }}/${{ env.SDK_TAR }}
- name: Create Release
if: ${{ github.ref == 'refs/heads/master' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}
allowUpdates: true
artifacts: ${{ env.SDK_TAR }}
token: ${{ secrets.GITHUB_TOKEN }}