forked from jcefmaven/jcefbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
309 lines (284 loc) · 10.6 KB
/
build-all.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: build-all
on:
workflow_dispatch:
inputs:
repo:
description: 'Git repository to clone'
required: true
default: 'https://bitbucket.org/chromiumembedded/java-cef.git'
ref:
description: 'Git commit id to checkout'
required: true
default: 'master'
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
release_tag_name: ${{ env.release_tag_name }}
build_meta: ${{ env.build_meta }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate release info
run: |
cd release_gen
chmod +x create_release_info.sh
./create_release_info.sh ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} ${{github.run_number}} ${{github.repository}}
- name: Create Release
run: |
gh release create ${{env.release_tag_name}} --title "${{env.release_name}}" --notes-file release_gen/release_message.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add LICENSE
run: |
gh release upload ${{env.release_tag_name}} release_gen/LICENSE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add build_meta.json
run: |
gh release upload ${{env.release_tag_name}} release_gen/build_meta.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Announce build_meta.json download url to other jobs
run: |
cd release_gen
chmod +x announce_build_meta.sh
./announce_build_meta.sh ${{ github.repository }}
build-linux-amd64:
runs-on: ubuntu-latest
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
run: |
chmod +x compile_linux.sh
./compile_linux.sh amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
- name: Export distribution
run: |
mv out/binary_distrib.tar.gz out/linux-amd64.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/linux-amd64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux-arm64:
runs-on: ubuntu-latest
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
run: |
chmod +x compile_linux.sh
./compile_linux.sh arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
- name: Export distribution
run: |
mv out/binary_distrib.tar.gz out/linux-arm64.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/linux-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux-arm:
runs-on: ubuntu-latest
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
run: |
chmod +x compile_linux.sh
./compile_linux.sh arm/v6 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
- name: Export distribution
run: |
mv out/binary_distrib.tar.gz out/linux-arm.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/linux-arm.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows-amd64:
runs-on: windows-2022
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
-
name: Build
shell: cmd
run: |
compile_windows.bat amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
- name: Export distribution
run: |
move out/binary_distrib.tar.gz out/windows-amd64.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/windows-amd64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows-i386:
runs-on: windows-2022
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
-
name: Build
shell: cmd
run: |
compile_windows.bat 386 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
- name: Export distribution
run: |
move out/binary_distrib.tar.gz out/windows-i386.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/windows-i386.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows-arm64:
runs-on: windows-2022
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
-
name: Build
shell: cmd
run: |
compile_windows.bat arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }}
- name: Export distribution
run: |
move out/binary_distrib.tar.gz out/windows-arm64.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/windows-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macosx-amd64:
runs-on: macos-12
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
-
name: Setup environment
run: |
chmod +x scripts/install_macos_dependencies.sh
./scripts/install_macos_dependencies.sh
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- uses: actions/setup-python@v5
with:
python-version: '3.10.11'
- name: Install Apple certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
-
name: Build
run: |
chmod +x compile_macosx.sh
./compile_macosx.sh amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} "${{ secrets.APPLE_BUILD_CERTIFICATE_NAME }}" ${{ secrets.APPLE_TEAM_NAME }} ${{ secrets.APPLE_API_ID }} ${{ secrets.APPLE_API_PASS }}
- name: Clean up keychain
if: ${{ always() }}
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm -rf "${HOME}/private_keys"
- name: Export distribution
run: |
mv out/binary_distrib.tar.gz out/macosx-amd64.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/macosx-amd64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Export javadoc
run: |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/javadoc.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macosx-arm64:
runs-on: macos-12
needs: create-release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
-
name: Setup environment
run: |
chmod +x scripts/install_macos_dependencies.sh
./scripts/install_macos_dependencies.sh
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- uses: actions/setup-python@v5
with:
python-version: '3.10.11'
- name: Install Apple certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
-
name: Build
run: |
chmod +x compile_macosx.sh
./compile_macosx.sh arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} "${{ secrets.APPLE_BUILD_CERTIFICATE_NAME }}" ${{ secrets.APPLE_TEAM_NAME }} ${{ secrets.APPLE_API_ID }} ${{ secrets.APPLE_API_PASS }}
- name: Clean up keychain
if: ${{ always() }}
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm -rf "${HOME}/private_keys"
- name: Export distribution
run: |
mv out/binary_distrib.tar.gz out/macosx-arm64.tar.gz
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/macosx-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}