quickjs/.github/workflows/release.yml

241 lines
6.4 KiB
YAML
Raw Normal View History

2023-11-22 21:46:07 +00:00
name: release
on:
push:
tags:
- "v*.*.*"
jobs:
linux-aarch64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: jirutka/setup-alpine@v1
with:
arch: aarch64
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-aarch64
mv build/qjsc build/qjsc-linux-aarch64
- name: check
shell: alpine.sh {0}
run: |
file build/*-linux-aarch64
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
path: build/*-linux-aarch64
2024-06-07 06:29:50 +00:00
linux-riscv64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: jirutka/setup-alpine@v1
with:
arch: riscv64
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-riscv64
mv build/qjsc build/qjsc-linux-riscv64
- name: check
shell: alpine.sh {0}
run: |
file build/*-linux-riscv64
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
path: build/*-linux-riscv64
2023-11-22 21:46:07 +00:00
linux-x86:
runs-on: ubuntu-20.04
2023-11-22 21:46:07 +00:00
steps:
- uses: actions/checkout@v4
2023-11-22 21:46:07 +00:00
- uses: jirutka/setup-alpine@v1
with:
arch: x86
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)
2023-11-22 21:46:07 +00:00
mv build/qjs build/qjs-linux-x86
2024-01-22 13:13:29 +00:00
mv build/qjsc build/qjsc-linux-x86
2023-11-22 21:46:07 +00:00
- name: check
shell: alpine.sh {0}
run: |
file build/*-linux-x86
2023-11-22 21:46:07 +00:00
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
2024-01-22 13:13:29 +00:00
path: build/*-linux-x86
2023-11-22 21:46:07 +00:00
linux-x86_64:
runs-on: ubuntu-20.04
2023-11-22 21:46:07 +00:00
steps:
- uses: actions/checkout@v4
2023-11-22 21:46:07 +00:00
- uses: jirutka/setup-alpine@v1
with:
arch: x86_64
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)
2023-11-22 21:46:07 +00:00
mv build/qjs build/qjs-linux-x86_64
2024-01-22 13:13:29 +00:00
mv build/qjsc build/qjsc-linux-x86_64
2023-11-22 21:46:07 +00:00
- name: check
shell: alpine.sh {0}
run: |
file build/*-linux-x86_64
2023-11-22 21:46:07 +00:00
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
2024-01-22 13:13:29 +00:00
path: build/*-linux-x86_64
2023-11-22 21:46:07 +00:00
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
2023-11-22 21:46:07 +00:00
- name: build
run: |
mkdir build
cd build
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ..
make -j$(getconf _NPROCESSORS_ONLN)
mv qjs qjs-darwin
2024-01-22 13:13:29 +00:00
mv qjsc qjsc-darwin
2023-11-22 21:46:07 +00:00
- name: check
run: |
2024-01-22 13:13:29 +00:00
lipo -info build/qjs-darwin build/qjsc-darwin
2023-11-22 21:46:07 +00:00
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
2024-01-22 13:13:29 +00:00
path: build/*-darwin
2023-11-22 21:46:07 +00:00
windows-x86:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
2023-11-22 21:46:07 +00:00
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: mingw32
install: >-
git
make
pacboy: >-
cmake:p
ninja:p
toolchain:p
- name: build
run: |
make
mv build/qjs.exe build/qjs-windows-x86.exe
2024-01-22 13:13:29 +00:00
mv build/qjsc.exe build/qjsc-windows-x86.exe
2023-11-22 21:46:07 +00:00
- name: check
run: |
2024-01-22 13:13:29 +00:00
ldd build/qjs-windows-x86.exe build/qjsc-windows-x86.exe
2023-11-22 21:46:07 +00:00
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
2024-01-22 13:13:29 +00:00
path: build/*-windows-x86.exe
2023-11-22 21:46:07 +00:00
windows-x86_64:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
2023-11-22 21:46:07 +00:00
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
install: >-
git
make
pacboy: >-
cmake:p
ninja:p
toolchain:p
- name: build
run: |
make
mv build/qjs.exe build/qjs-windows-x86_64.exe
2024-01-22 13:13:29 +00:00
mv build/qjsc.exe build/qjsc-windows-x86_64.exe
2023-11-22 21:46:07 +00:00
- name: check
run: |
2024-01-22 13:13:29 +00:00
ldd build/qjs-windows-x86_64.exe build/qjsc-windows-x86_64.exe
2023-11-22 21:46:07 +00:00
- name: upload
uses: actions/upload-artifact@v3
with:
name: qjs
2024-01-22 13:13:29 +00:00
path: build/*-windows-x86_64.exe
2023-11-22 21:46:07 +00:00
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@v3
with:
name: qjs
path: build/qjs-wasi.wasm
2023-11-22 21:46:07 +00:00
upload-to-release:
2024-03-11 10:23:11 +00:00
needs: [linux-x86, linux-x86_64, macos, windows-x86, windows-x86_64, wasi]
runs-on: ubuntu-20.04
2023-11-22 21:46:07 +00:00
steps:
- name: get assets
uses: actions/download-artifact@v3
with:
path: build
- name: release
uses: softprops/action-gh-release@v1
with:
files: |
2024-01-22 13:13:29 +00:00
build/qjs/qjs-*
build/qjs/qjsc-*