-
Notifications
You must be signed in to change notification settings - Fork 9
166 lines (140 loc) · 5.68 KB
/
ios.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Build ios
on:
push:
paths-ignore:
- '.github/workflows/android.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/mac.yml'
- '.github/workflows/win.yml'
- 'LICENSE'
- 'README.md'
concurrency:
group: ci-${{github.ref}}-ios
cancel-in-progress: true
jobs:
ios_build:
runs-on: macos-12
env:
QT_VERSION: '6.5.2'
TRIPLET: "arm64-ios"
DEPLOYMENT_TARGET: '14.0' # iOS Deployment target
XC_VERSION: ${{ '14.2' }}
QT_ARCH: "ios"
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change
steps:
- uses: actions/checkout@v3
with:
path: input-sdk
- name: Select latest Xcode
run: "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 cmake ninja
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: Cache Qt
id: cache-qt
uses: pat-s/[email protected]
with:
path: ${{ github.workspace }}/Qt
key: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-ios
- name: Install Qt
if: steps.cache-qt.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
ls -la ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}
- 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
git checkout $VCPKG_BASELINE
- 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 Qt6_HOST_DIR=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos
export PATH=${{ env.VCPKG_ROOT }}:$PATH
vcpkg --version
${{ github.workspace }}
ls -la ${{ github.workspace }}/Qt
ls -la ${Qt6_DIR}/lib
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }}/input-sdk \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
-G Ninja \
-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=ON \
-D CMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_MAKE_PROGRAM=ninja
- 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
ninja
- name: Get TimeStamp
id: time
uses: nanzm/[email protected]
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/
find libs/
tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./
- name: Upload Sdk in Artifacts
uses: actions/upload-artifact@v3
with:
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 }}