-
Notifications
You must be signed in to change notification settings - Fork 287
162 lines (155 loc) · 4.78 KB
/
release.yml
File metadata and controls
162 lines (155 loc) · 4.78 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
name: release
on:
pull_request:
push:
tags:
- "v*.*.*"
jobs:
check_meson_version:
runs-on: ubuntu-22.04
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/checkout@v6
- name: install meson and ninja
run: |
pip install --upgrade meson ninja
- name: check meson version
run: |
MESON_VERSION=$(meson introspect meson.build --projectinfo | jq -r '.version')
test "${{ github.ref_name }}" = "v${MESON_VERSION}"
linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [aarch64, armv7, riscv64, x86, x86_64]
steps:
- uses: actions/checkout@v6
- uses: jirutka/setup-alpine@v1
with:
arch: ${{matrix.arch}}
packages: "build-base make cmake"
- name: build
shell: alpine.sh {0}
run: |
mkdir build
cd build
cmake -DQJS_BUILD_WERROR=ON -DQJS_BUILD_CLI_STATIC=ON ..
cd ..
cmake --build build --target qjs_exe -j$(getconf _NPROCESSORS_ONLN)
cmake --build build --target qjsc -j$(getconf _NPROCESSORS_ONLN)
mv build/qjs build/qjs-linux-${{matrix.arch}}
mv build/qjsc build/qjsc-linux-${{matrix.arch}}
- name: check
shell: alpine.sh {0}
run: |
file build/*-linux-${{matrix.arch}}
- name: upload
uses: actions/upload-artifact@v7
with:
name: qjs-linux-${{matrix.arch}}
path: build/*-linux-${{matrix.arch}}
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: build
run: |
mkdir build
cd build
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DQJS_BUILD_WERROR=ON ..
make -j$(getconf _NPROCESSORS_ONLN)
make -C .. amalgam # writes build/quickjs-amalgam.zip
mv qjs qjs-darwin
mv qjsc qjsc-darwin
- name: check
run: |
lipo -info build/qjs-darwin build/qjsc-darwin
- name: upload amalgamation
uses: actions/upload-artifact@v7
with:
name: quickjs-amalgam.zip
path: build/quickjs-amalgam.zip
compression-level: 0 # already compressed
- name: upload
uses: actions/upload-artifact@v7
with:
name: qjs-darwin
path: build/*-darwin
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v6
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.arch == 'x86' && 'mingw32' || 'ucrt64' }}
install: >-
git
make
pacboy: >-
cmake:p
ninja:p
toolchain:p
- name: build
run: |
make
mv build/qjs.exe build/qjs-windows-${{matrix.arch}}.exe
mv build/qjsc.exe build/qjsc-windows-${{matrix.arch}}.exe
- name: check
run: |
file build/qjs-windows-${{matrix.arch}}.exe
ldd build/qjs-windows-${{matrix.arch}}.exe build/qjsc-windows-${{matrix.arch}}.exe
- name: upload
uses: actions/upload-artifact@v7
with:
name: qjs-windows-${{matrix.arch}}
path: build/*-windows-${{matrix.arch}}.exe
wasi:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: setup wasi-sdk
run: |
wget -nv https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-29/wasi-sdk-29.0-x86_64-linux.deb -P /tmp
sudo apt install /tmp/wasi-sdk*.deb
- name: build
run: |
cmake -B build -DCMAKE_TOOLCHAIN_FILE=/opt/wasi-sdk/share/cmake/wasi-sdk.cmake -DQJS_BUILD_WERROR=ON
make -C build qjs_exe
mv build/qjs build/qjs-wasi.wasm
- name: build wasi reactor
run: |
cmake -B build -DCMAKE_TOOLCHAIN_FILE=/opt/wasi-sdk/share/cmake/wasi-sdk.cmake -DQJS_BUILD_WERROR=ON -DQJS_WASI_REACTOR=ON
make -C build qjs_wasi
mv build/qjs.wasm build/qjs-wasi-reactor.wasm
- name: upload
uses: actions/upload-artifact@v7
with:
name: qjs-wasi
path: |
build/qjs-wasi.wasm
build/qjs-wasi-reactor.wasm
upload-to-release:
needs: [linux, macos, windows, wasi, check_meson_version]
runs-on: ubuntu-22.04
steps:
- name: get assets
uses: actions/download-artifact@v8
with:
path: build
merge-multiple: true
- run: ls -R build
- name: release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v2
with:
files: |
build/*