Skip to content

Commit b387026

Browse files
committed
ci: add linux static release
1 parent 10e6071 commit b387026

File tree

6 files changed

+118
-258
lines changed

6 files changed

+118
-258
lines changed

.github/codecov.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/create_release.yml

Lines changed: 0 additions & 245 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: release-static
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
release-linux-static:
12+
name: release-${{ matrix.arch }}-linux-static
13+
runs-on:
14+
- ${{ matrix.runner_tag }}
15+
- Linux
16+
- podman
17+
strategy:
18+
matrix:
19+
include:
20+
- arch: x86_64
21+
runner_tag: X64
22+
- arch: aarch64
23+
runner_tag: ARM64
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v4
27+
with:
28+
submodules: true
29+
30+
- name: build-image
31+
shell: bash
32+
run: |
33+
pushd "$(mktemp -d)"
34+
curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
35+
podman build \
36+
--network host \
37+
--pull \
38+
--squash-all \
39+
--tag rust:alpine-mimalloc \
40+
.
41+
popd
42+
43+
- name: build & test
44+
shell: bash
45+
run: |
46+
podman run \
47+
--env GITHUB_REF_NAME=$GITHUB_REF_NAME \
48+
--init \
49+
--network host \
50+
--rm \
51+
--volume $PWD:/workspace \
52+
--workdir /workspace \
53+
rust:alpine-mimalloc \
54+
/workspace/build-static.sh
55+
56+
podman rmi rust:alpine-mimalloc
57+
58+
- name: upload-artifact
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: binaryen-${{ matrix.arch }}-linux-static
62+
path: binaryen-*-${{ matrix.arch }}-linux-static.tar.gz

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ else() # MSVC
285285
else()
286286
add_link_flag("-Wl,--stack,8388608")
287287
endif()
288-
elseif(NOT EMSCRIPTEN)
288+
elseif((NOT EMSCRIPTEN) AND (NOT BUILD_STATIC_LIB))
289289
add_compile_flag("-fPIC")
290290
endif()
291291
add_debug_compile_flag("-g3")

build-static.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
apk upgrade
6+
apk add \
7+
alpine-sdk \
8+
clang \
9+
cmake \
10+
coreutils \
11+
git \
12+
lld \
13+
llvm \
14+
ninja-is-really-ninja \
15+
nodejs \
16+
py3-pip \
17+
zstd
18+
19+
VENV="$(mktemp -d)"
20+
21+
python3 -m venv "$VENV"
22+
23+
. "$VENV/bin/activate"
24+
25+
pip3 install -r requirements-dev.txt
26+
27+
cmake \
28+
-Bbuild \
29+
-G Ninja \
30+
-DCMAKE_BUILD_TYPE=Release \
31+
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
32+
-DCMAKE_JOB_POOLS="linking=1" \
33+
-DCMAKE_JOB_POOL_LINK=linking \
34+
-DCMAKE_C_COMPILER=clang \
35+
-DCMAKE_CXX_COMPILER=clang++ \
36+
-DCMAKE_INSTALL_PREFIX="/tmp/binaryen-$GITHUB_REF_NAME" \
37+
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -s -static -Wl,-z,stack-size=8388608" \
38+
-DBUILD_STATIC_LIB=ON \
39+
-DENABLE_WERROR=OFF \
40+
-DINSTALL_LIBS=OFF
41+
42+
cmake --build build --target install -- -v
43+
44+
CC=clang CXX=clang++ COMPILER_FLAGS="-Wno-unused-command-line-argument -fuse-ld=lld -s -static -Wl,-z,stack-size=8388608" ./check.py --binaryen-bin build/bin --binaryen-lib build/lib
45+
46+
tar \
47+
--sort=name \
48+
--owner=0 \
49+
--group=0 \
50+
--numeric-owner \
51+
--use-compress-program="gzip -9" \
52+
-cf "binaryen-$GITHUB_REF_NAME-$(uname -m)-linux-static.tar.gz" \
53+
-C /tmp \
54+
"binaryen-$GITHUB_REF_NAME"

check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def run():
371371
# Run all the tests
372372
def main():
373373
all_suites = TEST_SUITES.keys()
374-
skip_by_default = ['binaryenjs', 'binaryenjs_wasm']
374+
skip_by_default = ['binaryenjs', 'binaryenjs_wasm', 'wasm2js']
375375

376376
if shared.options.list_suites:
377377
for suite in all_suites:

0 commit comments

Comments
 (0)