-
Notifications
You must be signed in to change notification settings - Fork 35
151 lines (147 loc) · 4.81 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
on:
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-11
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- run: python3 script/build.py
- run: python3 script/test.py
- run: python3 script/package_platform.py
- uses: actions/upload-artifact@v3
with:
name: macos-x64-jars
path: target/skija-macos-x64-*
- run: python3 script/clean.py
- run: python3 script/build.py --arch arm64
- run: python3 script/package_platform.py --arch arm64
- uses: actions/upload-artifact@v3
with:
name: macos-arm64-jars
path: target/skija-macos-arm64-*
build_linux:
runs-on: ubuntu-20.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 g\+\+-9-aarch64-linux-gnu
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --config gcc
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: python3 script/build.py
- run: python3 script/package_shared.py
- uses: actions/upload-artifact@v3
with:
name: shared-jars
path: target/skija-shared-*.jar
- run: python3 script/test.py
- run: python3 script/package_platform.py
- uses: actions/upload-artifact@v3
with:
name: linux-x64-jars
path: target/skija-linux-x64-*
# Disabled until https://github.com/HumbleUI/SkiaBuild/issues/8
# - run: python3 script/clean.py
# - run: python3 script/build.py --arch arm64
# - run: python3 script/package_platform.py --arch arm64
# - uses: actions/upload-artifact@v3
# with:
# name: linux-arm64-jars
# path: target/skija-linux-arm64-*
build_windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1
- uses: ilammy/msvc-dev-cmd@v1
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
- shell: bash
run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- run: python3 script/build.py
- shell: bash
run: python3 script/test.py
- run: python3 script/package_platform.py
- uses: actions/upload-artifact@v3
with:
name: windows-x64-jars
path: target/skija-windows-x64-*
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build_windows, build_linux, build_macos]
steps:
- uses: actions/checkout@v3
- run: |
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
- uses: actions/download-artifact@v3
with:
name: shared-jars
path: target
- uses: actions/download-artifact@v3
with:
name: macos-x64-jars
path: target
- uses: actions/download-artifact@v3
with:
name: macos-arm64-jars
path: target
- uses: actions/download-artifact@v3
with:
name: linux-x64-jars
path: target
- uses: actions/download-artifact@v3
with:
name: linux-arm64-jars
path: target
- uses: actions/download-artifact@v3
with:
name: windows-x64-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 }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- 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-windows-*-sources.jar
rm target/skija-windows-*-javadoc.jar
- uses: softprops/action-gh-release@v1
with:
files: |
target/*.jmod
target/*.jar