-
Notifications
You must be signed in to change notification settings - Fork 23
348 lines (302 loc) · 10.3 KB
/
build-ceramic.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
name: Build ceramic
on:
push:
tags:
- v**
jobs:
build-ceramic-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '14.19.1'
- name: Setup NPM
working-directory: .
run: |
npm install -g [email protected]
- name: Setup Haxe
working-directory: .
run: |
$NEKOPATH = $(Convert-Path .)+'/git/haxe-binary/windows/neko'
$HAXEPATH = $(Convert-Path .)+'/git/haxe-binary/windows/haxe'
echo $NEKOPATH >> $GITHUB_PATH
echo $HAXEPATH >> $GITHUB_PATH
echo $NEKOPATH
echo $HAXEPATH
- name: Build ceramic
working-directory: ./node
run: |
npm ci
cd ../tools
./npm ci
./node post-install.js
cd ../runner
../tools/npm ci
cd ..
- name: Cleanup
working-directory: .
run: |
Remove-Item 'git/haxe-binary/linux' -Recurse
Remove-Item 'git/haxe-binary/mac' -Recurse
cd tools
Remove-Item './npm'
Remove-Item './npx'
Remove-Item './node'
Remove-Item './haxe'
Remove-Item './haxelib'
Remove-Item './neko'
Remove-Item './ceramic'
cd ..
- name: Run ceramic
working-directory: ./tools
run: |
./ceramic
- name: Check ceramic version
working-directory: ./tools
run: |
$GIT_TAG = $($env:GITHUB_REF).replace("refs/tags/", "")
./ceramic version --check-tag $GIT_TAG
- name: Create zip archive
working-directory: .
run: |
$ZIP_COMPRESS = $(Convert-Path .)
$ZIP_EXCLUDE = @(".git", ".github", "ceramic-windows.zip")
$ZIP_DESTINATION = 'ceramic-windows.zip'
$ZIP_FILES = Get-ChildItem -Path $ZIP_COMPRESS -Exclude $ZIP_EXCLUDE
Compress-Archive -Path $ZIP_FILES -DestinationPath $ZIP_DESTINATION -CompressionLevel Optimal
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-windows.zip
path: ceramic-windows.zip
compression-level: 0
build-ceramic-mac:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '14.19.1'
architecture: 'x64'
- name: Setup NPM
working-directory: .
run: |
sudo npm install -g [email protected]
- name: Install System Dependencies
run: |
brew install vips pkg-config python-setuptools
python3 -m pip install setuptools distutils-precedence
- name: Setup Haxe
working-directory: .
run: |
set -ex
export NEKOPATH=$PWD'/git/haxe-binary/mac/neko'
export HAXEPATH=$PWD'/git/haxe-binary/mac/haxe'
echo 'neko path: '$NEKOPATH
echo 'haxe path: '$HAXEPATH
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/share/haxe
sudo ln -s $HAXEPATH/haxe /usr/local/bin/haxe
sudo ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib
sudo ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin
sudo ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin
sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std
sudo ln -s $NEKOPATH/neko /usr/local/bin/neko
sudo ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc
sudo ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml
sudo ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools
sudo ln -s $NEKOPATH /usr/local/lib/neko
sudo ln -s $NEKOPATH/libneko.dylib /usr/local/lib/libneko.dylib
sudo ln -s $NEKOPATH/libneko.2.4.0.dylib /usr/local/lib/libneko.2.4.0.dylib
sudo ln -s $NEKOPATH/libneko.2.dylib /usr/local/lib/libneko.2.dylib
set +x
echo 'neko: '$(neko -version)
echo 'haxe: '$(haxe --version)
- name: Build ceramic
working-directory: ./node
env:
SHARP_IGNORE_GLOBAL_LIBVIPS: 1
npm_config_build_from_source: true
run: |
npm ci
cd ../tools
./npm ci
./node post-install.js
cd ../runner
../tools/npm ci
cd ..
- name: Cleanup
working-directory: .
run: |
rm -rf git/haxe-binary/linux
rm -rf git/haxe-binary/windows
cd tools
rm -f ./npm.cmd
rm -f ./npx.cmd
rm -f ./node.cmd
rm -f ./haxe.cmd
rm -f ./neko.cmd
rm -f ./ceramic.cmd
cd ..
- name: Run ceramic
working-directory: ./tools
run: |
./ceramic
- name: Check ceramic version
working-directory: ./tools
run: |
GIT_TAG=${GITHUB_REF/refs\/tags\//}
./ceramic version --check-tag $GIT_TAG
- name: Create zip archive
run: zip --symlinks -9 -r 'ceramic-mac.zip' . -x ".git/*" ".github/*"
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-mac.zip
path: ceramic-mac.zip
compression-level: 0
build-ceramic-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '14.19.1'
- name: Setup NPM
working-directory: .
run: |
sudo npm install -g [email protected]
- name: Setup Haxe
working-directory: .
run: |
export NEKOPATH=$PWD'/git/haxe-binary/linux/neko'
export HAXEPATH=$PWD'/git/haxe-binary/linux/haxe'
echo 'neko path: '$NEKOPATH
echo 'haxe path: '$HAXEPATH
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/share/haxe
sudo ln -s $HAXEPATH/haxe /usr/local/bin/haxe
sudo ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib
sudo ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin
sudo ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin
sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std
sudo ln -s $NEKOPATH/neko /usr/local/bin/neko
sudo ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc
sudo ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml
sudo ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools
sudo ln -s $NEKOPATH /usr/local/lib/neko
sudo ln -s $NEKOPATH/libneko.so /usr/local/lib/libneko.so
sudo ln -s $NEKOPATH/libneko.so.2.3.0 /usr/local/lib/libneko.so.2.3.0
sudo ln -s $NEKOPATH/libneko.so.2 /usr/local/lib/libneko.so.2
sudo ldconfig
sudo ldconfig /usr/local/lib
echo 'neko: '$(neko -version)
echo 'haxe: '$(haxe --version)
- name: Build ceramic
working-directory: ./node
run: |
npm ci
cd ../tools
./npm ci
./node post-install.js
cd ../runner
../tools/npm ci
cd ..
- name: Cleanup
working-directory: .
run: |
rm -rf git/haxe-binary/mac
rm -rf git/haxe-binary/windows
cd tools
rm -f ./npm.cmd
rm -f ./npx.cmd
rm -f ./node.cmd
rm -f ./haxe.cmd
rm -f ./neko.cmd
rm -f ./ceramic.cmd
cd ..
- name: Run ceramic
working-directory: ./tools
run: |
./ceramic
- name: Check ceramic version
working-directory: ./tools
run: |
GIT_TAG=${GITHUB_REF/refs\/tags\//}
./ceramic version --check-tag $GIT_TAG
- name: Create zip archive
run: zip --symlinks -9 -r 'ceramic-linux.zip' . -x ".git/*" ".github/*"
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-linux.zip
path: ceramic-linux.zip
compression-level: 0
create-release:
needs: [build-ceramic-windows, build-ceramic-mac, build-ceramic-linux]
runs-on: ubuntu-22.04
steps:
- name: Download ceramic-windows.zip
uses: actions/download-artifact@v4
with:
name: ceramic-windows.zip
path: ceramic-windows.zip
- name: Download ceramic-mac.zip
uses: actions/download-artifact@v4
with:
name: ceramic-mac.zip
path: ceramic-mac.zip
- name: Download ceramic-linux.zip
uses: actions/download-artifact@v4
with:
name: ceramic-linux.zip
path: ceramic-linux.zip
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: ${{ env.TAG_NAME }}
body: |
Ceramic ${{ env.TAG_NAME }}
draft: false
prerelease: false
files: |
ceramic-windows.zip
ceramic-mac.zip
ceramic-linux.zip
generate-api-docs:
needs: [create-release]
runs-on: ubuntu-22.04
steps:
- name: Dispatch event
uses: ceramic-engine/repository-dispatch@v1
with:
token: ${{ secrets.PAT_PUBLIC }}
repository: ceramic-engine/api-docs
event-type: deploy-api-docs
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'