Skip to content

Commit 016e4af

Browse files
wyasudawyasuda
andauthored
iOS, Androidビルド自動化 (Synesthesias#150)
* first try * second try * second try * 3rd try * 4th try * 5th try * 6th try * first try for iOS * first try for iOS * combile Android and iOS process * upload Android and iOS dlls * upload Android and iOS dlls, 2nd try * upload Android and iOS dlls, 3rd try * upload Android and iOS dlls, 4th try * upload Android and iOS dlls, 5th try * upload Android and iOS dlls, 6th try * upload Android and iOS dlls, 7th try * revert on: conditions --------- Co-authored-by: wyasuda <you@example.com>
1 parent c0494d9 commit 016e4af

File tree

1 file changed

+114
-2
lines changed

1 file changed

+114
-2
lines changed

.github/workflows/upload-dlls.yml

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,120 @@ jobs:
7777
name: libplateau-${{matrix.os}}-dll
7878
path: ${{env.HOME}}/output/
7979

80+
# 2つ目のジョブ。
81+
# AndroidとiOS用にライブラリをビルド。
82+
upload_mobile_dlls:
8083

81-
# 2つ目のジョブです。
84+
runs-on: ${{matrix.os}}
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
os: [macos-latest, ubuntu-latest]
89+
compile-sdk: [33]
90+
build-tools: [30.0.3]
91+
ndk-version: [23.1.7779620]
92+
93+
steps:
94+
- uses: actions/checkout@v3
95+
96+
- name: Add SSH private keys for submodule repositories
97+
uses: webfactory/ssh-agent@v0.7.0
98+
with:
99+
ssh-private-key: |
100+
${{ secrets.KEY_TO_ACCESS_FBXSDK }}
101+
102+
- name: checkout submodules
103+
shell: bash
104+
run: git submodule update --init --recursive
105+
106+
- name: setup ubuntu
107+
if: runner.os == 'Linux'
108+
run: |
109+
sudo apt-get --quiet update --yes
110+
sudo apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
111+
112+
- name: setup JDK 1.8
113+
if: runner.os == 'Linux'
114+
uses: actions/setup-java@v2
115+
with:
116+
distribution: 'zulu'
117+
java-version: '11'
118+
119+
- name: download Android SDK
120+
if: runner.os == 'Linux'
121+
run: |
122+
wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip
123+
unzip -d android-sdk-linux android-sdk.zip
124+
sudo mkdir -p /root/.android
125+
sudo touch /root/.android/repositories.cfg
126+
echo y | android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=. "platforms;android-${{ matrix.compile-sdk }}" >/dev/null
127+
echo y | android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=. "platform-tools" >/dev/null
128+
echo y | android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=. "build-tools;${{ matrix.build-tools }}" >/dev/null
129+
export ANDROID_SDK_ROOT=$PWD
130+
export PATH=$PATH:$PWD/platform-tools/
131+
set +o pipefail
132+
yes | android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=. --licenses
133+
set -o pipefail
134+
135+
- name: install Android NDK
136+
if: runner.os == 'Linux'
137+
run: android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=. --install "ndk;${{ matrix.ndk-version }}"
138+
139+
- name: Insert NDK path
140+
if: runner.os == 'Linux'
141+
run: |
142+
echo "ndk.dir=$PWD/ndk/${{ matrix.ndk-version }}" >> ./local.properties
143+
144+
- name: Install ninja-build tool
145+
if: runner.os == 'Linux'
146+
uses: seanmiddleditch/gha-setup-ninja@v3
147+
148+
- name: Configure CMake for Android
149+
if: runner.os == 'Linux'
150+
run: >
151+
cmake
152+
-S ${{github.workspace}}
153+
-B ${{github.workspace}}/out/build/x64-Release
154+
-G "Ninja"
155+
-D ANDROID_PLATFORM=android-23
156+
-D ANDROID_ABI=arm64-v8a
157+
-D CMAKE_MAKE_PROGRAM=ninja
158+
-D CMAKE_BUILD_TYPE=Release
159+
-D CMAKE_TOOLCHAIN_FILE=$PWD/ndk/${{ matrix.ndk-version }}/build/cmake/android.toolchain.cmake
160+
161+
- name: Configure CMake for iOS
162+
if: runner.os == 'MacOS'
163+
run: >
164+
cmake
165+
-S ${{github.workspace}}
166+
-B ${{github.workspace}}/out/build/x64-Release
167+
-G "Xcode"
168+
-D CMAKE_SYSTEM_NAME=iOS
169+
-D CMAKE_OSX_DEPLOYMENT_TARGET=13.0
170+
-D CMAKE_BUILD_TYPE=Release
171+
172+
- name: Build by CMake
173+
run: cmake --build ${{github.workspace}}/out/build/x64-Release --config Release
174+
175+
- name: Upload framework for Android
176+
if: runner.os == 'Linux'
177+
uses: actions/upload-artifact@v2
178+
with:
179+
name: libplateau-android-dll
180+
path: ${{github.workspace}}/out/build/x64-Release/src/libplateau.so
181+
182+
- name: Upload framework for iOS
183+
if: runner.os == 'MacOS'
184+
uses: actions/upload-artifact@v2
185+
with:
186+
name: libplateau-ios-dll
187+
path: ${{github.workspace}}/out/build/x64-Release/src/Release-iphoneos/plateau.framework/*
188+
189+
# 3つ目のジョブです。
82190
# OSごとのアーティファクトを1つにまとめます。
83191
sum-up-dlls:
84192
runs-on: ubuntu-latest
85-
needs: upload-dlls
193+
needs: [upload-dlls, upload_mobile_dlls]
86194

87195
steps:
88196
- name: download-all-artifacts
@@ -96,10 +204,14 @@ jobs:
96204
mkdir -p ~/a/plateau-plugins/dynamic-libs/Linux/x86_64
97205
mkdir -p ~/a/plateau-plugins/dynamic-libs/MacOS/x86_64
98206
mkdir -p ~/a/plateau-plugins/dynamic-libs/ManagedDLL
207+
mkdir -p ~/a/plateau-plugins/dynamic-libs/Android
208+
mkdir -p ~/a/plateau-plugins/dynamic-libs/iOS/plateau.framework
99209
cp ~/a/libplateau-windows-dll/plateau.dll ~/a/plateau-plugins/dynamic-libs/Windows/x86_64
100210
cp ~/a/libplateau-windows-dll/CSharpPLATEAU.dll ~/a/plateau-plugins/dynamic-libs/ManagedDLL
101211
cp ~/a/libplateau-ubuntu-18.04-dll/*.so ~/a/plateau-plugins/dynamic-libs/Linux/x86_64
102212
cp ~/a/libplateau-macos-latest-dll/*.dylib ~/a/plateau-plugins/dynamic-libs/MacOS/x86_64
213+
cp ~/a/libplateau-android-dll/libplateau.so ~/a/plateau-plugins/dynamic-libs/Android
214+
cp ~/a/libplateau-ios-dll/* ~/a/plateau-plugins/dynamic-libs/iOS/plateau.framework
103215
104216
- name: sum-up-static-libs
105217
run: |

0 commit comments

Comments
 (0)