-
Notifications
You must be signed in to change notification settings - Fork 105
136 lines (130 loc) · 3.68 KB
/
release.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
name: release
on:
pull_request:
push:
tags:
- "v*.*.*"
jobs:
linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [aarch64, riscv64, x86, x86_64]
steps:
- uses: actions/checkout@v4
- 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 -DBUILD_STATIC_QJS_EXE=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@v4
with:
name: qjs-linux-${{matrix.arch}}
path: build/*-linux-${{matrix.arch}}
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: build
run: |
mkdir build
cd build
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ..
make -j$(getconf _NPROCESSORS_ONLN)
mv qjs qjs-darwin
mv qjsc qjsc-darwin
- name: check
run: |
lipo -info build/qjs-darwin build/qjsc-darwin
- name: upload
uses: actions/upload-artifact@v4
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@v4
- 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@v4
with:
name: qjs-windows-${{matrix.arch}}
path: build/*-windows-${{matrix.arch}}.exe
wasi:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: setup wasi-sdk
run: |
wget -nv https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk_21.0_amd64.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
make -C build qjs_exe
mv build/qjs build/qjs-wasi.wasm
- name: upload
uses: actions/upload-artifact@v4
with:
name: qjs-wasi
path: build/qjs-wasi.wasm
upload-to-release:
needs: [linux, macos, windows, wasi]
runs-on: ubuntu-20.04
steps:
- name: get assets
uses: actions/download-artifact@v4
with:
pattern: qjs-*
path: build
merge-multiple: true
- run: ls -R build
- name: release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1
with:
files: |
build/*