Skip to content

Commit 0f498b3

Browse files
committed
ci: add x86_64-linux-static release
1 parent 4179603 commit 0f498b3

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

.github/workflows/release-static.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: release-static
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
release-static:
11+
name: release-x86_64-linux-static
12+
runs-on: ubuntu-24.04
13+
steps:
14+
15+
- name: system-deps
16+
run: |
17+
sudo apt install -y \
18+
ninja-build
19+
20+
- name: checkout
21+
uses: actions/checkout@v4
22+
23+
- name: checkout-submodules
24+
run: git submodule update --init --depth 1 --jobs 2
25+
26+
- name: build
27+
run: |
28+
cmake \
29+
-Bbuild \
30+
-G Ninja \
31+
-DCMAKE_BUILD_TYPE=Release \
32+
-DCMAKE_INSTALL_PREFIX="/tmp/binaryen-$GITHUB_REF_NAME" \
33+
-DCMAKE_EXE_LINKER_FLAGS="-s -static" \
34+
-DBUILD_STATIC_LIB=ON \
35+
-DENABLE_WERROR=OFF \
36+
-DINSTALL_LIBS=OFF
37+
38+
cmake --build build --target install -- -v
39+
40+
tar \
41+
--sort=name \
42+
--owner=0 \
43+
--group=0 \
44+
--numeric-owner \
45+
-czf "binaryen-$GITHUB_REF_NAME-x86_64-linux-static.tar.gz" \
46+
-C /tmp \
47+
"binaryen-$GITHUB_REF_NAME"
48+
49+
- name: upload-artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: binaryen-x86_64-linux-static
53+
path: binaryen-*-x86_64-linux-static.tar.gz
54+
55+
- name: test
56+
run: |
57+
VENV_PATH=$(mktemp -d)
58+
python3 -m venv $VENV_PATH
59+
source $VENV_PATH/bin/activate
60+
61+
pip3 install -r requirements-dev.txt
62+
63+
COMPILER_FLAGS="-s -static" ./check.py --binaryen-bin build/bin --binaryen-lib build/lib

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ else()
309309
else()
310310
add_link_flag("-Wl,--stack,8388608")
311311
endif()
312-
elseif(NOT EMSCRIPTEN)
312+
elseif((NOT EMSCRIPTEN) AND (NOT BUILD_STATIC_LIB))
313313
add_compile_flag("-fPIC")
314314
endif()
315315
add_debug_compile_flag("-g3")

0 commit comments

Comments
 (0)