-
Notifications
You must be signed in to change notification settings - Fork 76
163 lines (130 loc) · 3.47 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
name: Compile binaries
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
linux-x86:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
libc: [glibc, musl]
container:
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }}
options: --user github
steps:
- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout skia-canvas
uses: actions/checkout@v4
- name: Build module
run: |
mkdir -p $CARGO_HOME/registry
chown -R github $CARGO_HOME/registry
make optimized
- name: Package module
run: |
npm test && npm run package
- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run upload
linux-arm64:
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
matrix:
libc: [glibc, musl]
container:
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }}
options: --user github
steps:
- name: Prepare workspace
run: |
rm -rf "$GITHUB_WORKSPACE"
mkdir -p "$GITHUB_WORKSPACE"
- name: Install rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
- name: Checkout skia-canvas
env:
SERVER: ${{ github.server_url }}
REPO: ${{ github.repository }}
REF: ${{ github.ref_name }}
run: |
git clone --depth 1 --branch $REF ${SERVER}/${REPO} .
- name: Build module
run: |
make optimized
- name: Package module
run: |
npm test && npm run package
- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run upload
mac:
strategy:
fail-fast: false
matrix:
arch: [x86, arm64]
runs-on: ${{ matrix.arch == 'x86' && 'macos-13' || 'macos-14' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Build module
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
run: make optimized
- name: Package module
run: npm test && npm run package
- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run upload
windows-x86:
runs-on: windows-latest
steps:
- name: Enable long paths
run: git config --system core.longpaths true
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Build module
run: make optimized
- name: Package module
run: npm test && npm run package
- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set script-shell bash
npm run upload