-
Notifications
You must be signed in to change notification settings - Fork 12
215 lines (211 loc) · 7.09 KB
/
build.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: build
on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
schedule:
- cron: "0 0 * * *"
jobs:
build-windows:
strategy:
fail-fast: false
matrix:
name:
- windows_x86_64
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: _install
key: ${{ matrix.name }}-v3-${{ hashFiles('VERSIONS') }}
restore-keys: |
${{ matrix.name }}-v3-
- run: python3 run.py ${{ matrix.name }}
- name: Copy ${{ matrix.name }} files
run: |
mkdir ${{ matrix.name }}
Copy-Item _build\windows_x86_64\release\sora_unity_sdk\Release\SoraUnitySdk.dll ${{ matrix.name }}
# ソースコード(生成した分も含む)も一緒に入れておく
Copy-Item -Recurse Sora ${{ matrix.name }}\Sora
# Lyra のモデルデータも一緒に入れておく
Copy-Item -Recurse _install\windows_x86_64\release\lyra\share\model_coeffs ${{ matrix.name }}\model_coeffs
- name: Upload ${{ matrix.name }} Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}
build-macos:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
- ios
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: _install
key: ${{ matrix.name }}-v7-${{ hashFiles('VERSIONS') }}
restore-keys: |
${{ matrix.name }}-v7-
- run: python3 run.py ${{ matrix.name }}
# macOS 用
- name: Copy macOS arm64 files
if: matrix.name == 'macos_arm64'
run: |
mkdir macos_arm64/
cp -r _build/macos_arm64/release/sora_unity_sdk/SoraUnitySdk.bundle/ macos_arm64/SoraUnitySdk.bundle/
- name: Upload macOS arm64 Artifact
if: matrix.name == 'macos_arm64'
uses: actions/upload-artifact@v3
with:
name: macos_arm64
path: macos_arm64/
# iOS 用
- name: Copy iOS files
if: matrix.name == 'ios'
run: |
mkdir ios/
cp _install/ios/release/webrtc/lib/libwebrtc.a ios/
cp _install/ios/release/boost/lib/libboost_json.a ios/
cp _install/ios/release/boost/lib/libboost_filesystem.a ios/
cp _install/ios/release/sora/lib/libsora.a ios/
cp _install/ios/release/lyra/lib/liblyra.a ios/
cp _build/ios/release/sora_unity_sdk/libSoraUnitySdk.a ios/
- name: Upload iOS Artifact
if: matrix.name == 'ios'
uses: actions/upload-artifact@v3
with:
name: ios
path: ios/
build-ubuntu:
strategy:
fail-fast: false
matrix:
name:
- android
- ubuntu-20.04_x86_64
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: _install
key: ${{ matrix.name }}-v1-${{ hashFiles('VERSIONS') }}
restore-keys: |
${{ matrix.name }}-v1-
- name: Prepare Ubuntu x86_64
if: matrix.name == 'ubuntu-20.04_x86_64'
run: |
sudo apt install libdrm-dev libva-dev libgl-dev
- run: python3 run.py ${{ matrix.name }}
# Android 用
- name: Copy Android files
if: matrix.name == 'android'
run: |
mkdir android/
cp _install/android/release/webrtc/jar/webrtc.jar android/
cp _build/android/release/sora_unity_sdk/libSoraUnitySdk.so android/
- name: Upload Android Artifact
if: matrix.name == 'android'
uses: actions/upload-artifact@v3
with:
name: android
path: android/
# Ubuntu 用
- name: Copy Ubuntu x86_64 files
if: matrix.name == 'ubuntu-20.04_x86_64'
run: |
mkdir ubuntu-20.04_x86_64/
cp _build/ubuntu-20.04_x86_64/release/sora_unity_sdk/libSoraUnitySdk.so ubuntu-20.04_x86_64/
- name: Upload Ubuntu x86_64 Artifact
if: matrix.name == 'ubuntu-20.04_x86_64'
uses: actions/upload-artifact@v3
with:
name: ubuntu-20.04_x86_64
path: ubuntu-20.04_x86_64/
package:
runs-on: ubuntu-20.04
needs:
- build-windows
- build-macos
- build-ubuntu
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Packaging
run: |
set -ex
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/windows/x86_64
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/macos/arm64
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/ios
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/android/arm64-v8a
mkdir -p SoraUnitySdk/Plugins/SoraUnitySdk/linux/x86_64
mkdir -p SoraUnitySdk/StreamingAssets/SoraUnitySdk
cp windows_x86_64/SoraUnitySdk.dll SoraUnitySdk/Plugins/SoraUnitySdk/windows/x86_64/
cp -r windows_x86_64/Sora/ SoraUnitySdk/SoraUnitySdk/
cp -r windows_x86_64/model_coeffs SoraUnitySdk/StreamingAssets/SoraUnitySdk/model_coeffs
cp -r macos_arm64/SoraUnitySdk.bundle SoraUnitySdk/Plugins/SoraUnitySdk/macos/arm64/SoraUnitySdk.bundle
cp android/libSoraUnitySdk.so SoraUnitySdk/Plugins/SoraUnitySdk/android/arm64-v8a/
cp android/webrtc.jar SoraUnitySdk/Plugins/SoraUnitySdk/android/
cp ios/libSoraUnitySdk.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libwebrtc.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libboost_json.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libsora.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/libboost_filesystem.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ios/liblyra.a SoraUnitySdk/Plugins/SoraUnitySdk/ios/
cp ubuntu-20.04_x86_64/libSoraUnitySdk.so SoraUnitySdk/Plugins/SoraUnitySdk/linux/x86_64/
cp LICENSE SoraUnitySdk/SoraUnitySdk/
cp NOTICE.md SoraUnitySdk/SoraUnitySdk/
- name: Upload SoraUnitySdk
uses: actions/upload-artifact@v3
with:
name: SoraUnitySdk
path: SoraUnitySdk
release:
name: Upload Release Asset
if: contains(github.ref, 'tags/202')
needs: [package]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download SoraUnitySdk
uses: actions/download-artifact@v3
with:
name: SoraUnitySdk
path: SoraUnitySdk
- name: Archive to zip SoraUnitySdk
run: |
zip -r SoraUnitySdk SoraUnitySdk
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./SoraUnitySdk.zip
asset_name: SoraUnitySdk.zip
asset_content_type: application/zip