-
Notifications
You must be signed in to change notification settings - Fork 53
216 lines (211 loc) · 6.69 KB
/
Copy pathbuild.yml
File metadata and controls
216 lines (211 loc) · 6.69 KB
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
on:
pull_request:
branches:
- 'master'
paths:
- '.github'
- 'platform'
- 'script'
- 'shared'
- 'tests'
push:
branches:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths-ignore:
- 'docs/**'
- 'examples/**'
- 'extras/**'
- .dockerignore
- .gitignore
- CHANGELOG.md
- Dockerfile
- LICENSE
- README.md
jobs:
build_macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_arm64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_arm64/bin" >> $GITHUB_PATH
# x64
- run: python3 script/build.py --arch x64
- run: python3 script/test.py
- run: python3 script/package_platform.py --arch x64
- uses: actions/upload-artifact@v6
with:
name: macos-x64-jars
path: target/skija-macos-x64-*
# arm64
- run: python3 script/clean.py
- run: python3 script/build.py --arch arm64
- run: python3 script/test.py
- run: python3 script/package_platform.py --arch arm64
- uses: actions/upload-artifact@v6
with:
name: macos-arm64-jars
path: target/skija-macos-arm64-*
build_linux:
runs-on: ubuntu-22.04
steps:
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
sudo apt-get update
sudo apt-get --quiet --yes install ninja-build libglu1-mesa-dev libegl-dev g\+\+-10-aarch64-linux-gnu libwayland-dev libglvnd-dev libegl1-mesa libegl1-mesa-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10
sudo update-alternatives --config gcc
- uses: actions/checkout@v5
with:
fetch-depth: 0
# x64
- run: python3 script/build.py
- run: python3 script/package_shared.py
- uses: actions/upload-artifact@v6
with:
name: shared-jars
path: target/skija-shared-*.jar
- run: python3 script/test.py
- run: python3 script/package_platform.py
- uses: actions/upload-artifact@v6
with:
name: linux-x64-jars
path: target/skija-linux-x64-*
# arm64
- run: python3 script/clean.py
- run: python3 script/build.py --arch arm64
- run: python3 script/package_platform.py --arch arm64
- uses: actions/upload-artifact@v6
with:
name: linux-arm64-jars
path: target/skija-linux-arm64-*
build_android:
runs-on: ubuntu-22.04
strategy:
matrix:
arch: ["arm64", "x64"]
fail-fast: false
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Java
run: |
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_17_X64/bin" >> $GITHUB_PATH
- name: Setup Android NDK
uses: android-actions/setup-android@v3
- name: Install NDK
run: sdkmanager "ndk;25.1.8937393"
- name: Set NDK Home
run: echo "ANDROID_NDK_HOME=${{ env.ANDROID_HOME }}/ndk/25.1.8937393" >> $GITHUB_ENV
- name: Build Android ${{ matrix.arch }}
run: python3 script/build.py --system android --arch ${{ matrix.arch }}
- name: Package Android ${{ matrix.arch }}
run: python3 script/package_platform.py --system android --arch ${{ matrix.arch }}
- uses: actions/upload-artifact@v6
with:
name: android-${{ matrix.arch }}-jars
path: target/skija-android-${{ matrix.arch }}-*
build_windows:
strategy:
matrix:
os: [ windows-2022, windows-11-arm ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- run: |
$os_arch = "${{ runner.arch }}".ToLower()
echo "os_arch=$os_arch" >> $env:GITHUB_ENV
- uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: ${{ env.os_arch }}
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ env.os_arch }}
- uses: actions/setup-java@v5
with:
distribution: 'microsoft'
java-version: '11'
- run: python3 script/build.py
- shell: bash
run: python3 script/test.py
- run: python3 script/package_platform.py
- uses: actions/upload-artifact@v7
with:
name: windows-${{ env.os_arch }}-jars
path: target/skija-windows-${{ env.os_arch }}-*
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build_windows, build_linux, build_macos, build_android]
steps:
- uses: actions/checkout@v5
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- uses: actions/download-artifact@v6
with:
name: shared-jars
path: target
- uses: actions/download-artifact@v6
with:
name: macos-x64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: macos-arm64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: linux-x64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: linux-arm64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: android-arm64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: android-x64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: windows-x64-jars
path: target
- uses: actions/download-artifact@v6
with:
name: windows-arm64-jars
path: target
- name: Release to Maven Central
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
python3 ./script/release.py
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
SONATYPE_BEARER_TOKEN: ${{ secrets.SONATYPE_BEARER_TOKEN }}
- name: Delete useless jars
run: |
rm target/skija-macos-*-sources.jar
rm target/skija-macos-*-javadoc.jar
rm target/skija-linux-*-sources.jar
rm target/skija-linux-*-javadoc.jar
rm target/skija-android-*-sources.jar
rm target/skija-android-*-javadoc.jar
rm target/skija-windows-*-sources.jar
rm target/skija-windows-*-javadoc.jar
- uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md
files: |
target/*.jmod
target/*.jar