Skip to content

Commit

Permalink
ci: add x86_64-linux-static release
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack committed Jul 16, 2024
1 parent 4179603 commit 0f498b3
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/release-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: release-static

on:
push:
tags:
- "*"
workflow_dispatch:

jobs:
release-static:
name: release-x86_64-linux-static
runs-on: ubuntu-24.04
steps:

- name: system-deps
run: |
sudo apt install -y \
ninja-build
- name: checkout
uses: actions/checkout@v4

- name: checkout-submodules
run: git submodule update --init --depth 1 --jobs 2

- name: build
run: |
cmake \
-Bbuild \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/tmp/binaryen-$GITHUB_REF_NAME" \
-DCMAKE_EXE_LINKER_FLAGS="-s -static" \
-DBUILD_STATIC_LIB=ON \
-DENABLE_WERROR=OFF \
-DINSTALL_LIBS=OFF
cmake --build build --target install -- -v
tar \
--sort=name \
--owner=0 \
--group=0 \
--numeric-owner \
-czf "binaryen-$GITHUB_REF_NAME-x86_64-linux-static.tar.gz" \
-C /tmp \
"binaryen-$GITHUB_REF_NAME"
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: binaryen-x86_64-linux-static
path: binaryen-*-x86_64-linux-static.tar.gz

- name: test
run: |
VENV_PATH=$(mktemp -d)
python3 -m venv $VENV_PATH
source $VENV_PATH/bin/activate
pip3 install -r requirements-dev.txt
COMPILER_FLAGS="-s -static" ./check.py --binaryen-bin build/bin --binaryen-lib build/lib
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ else()
else()
add_link_flag("-Wl,--stack,8388608")
endif()
elseif(NOT EMSCRIPTEN)
elseif((NOT EMSCRIPTEN) AND (NOT BUILD_STATIC_LIB))
add_compile_flag("-fPIC")
endif()
add_debug_compile_flag("-g3")
Expand Down

0 comments on commit 0f498b3

Please sign in to comment.