summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml50
1 files changed, 42 insertions, 8 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a3c8953fb..41333e2f8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -13,8 +13,11 @@ jobs:
matrix:
os: [linux, macos, windows]
config: [release]
- platform: [x86_64, aarch64]
+ platform: [x86_64, aarch64, wasm]
test-category: [smoke]
+ exclude:
+ - { os: windows, platform: wasm }
+ - { os: macos, platform: wasm }
include:
- {
os: linux,
@@ -28,6 +31,13 @@ jobs:
runs-on: ubuntu-24.04-arm,
compiler: gcc,
}
+ - {
+ os: linux,
+ platform: wasm,
+ runs-on: ubuntu-22.04,
+ compiler: gcc,
+ build-slang-llvm: false,
+ }
- { os: windows, runs-on: windows-latest, compiler: cl }
- { os: macos, runs-on: macos-latest, compiler: clang }
@@ -90,6 +100,18 @@ jobs:
- name: Build Slang
run: |
+ if [[ "${{ matrix.platform }}" == "wasm" ]]; then
+ git clone https://github.com/emscripten-core/emsdk.git
+ pushd emsdk
+ ./emsdk install latest
+ ./emsdk activate latest
+ source ./emsdk_env.sh
+ popd
+ emcmake cmake -DSLANG_GENERATORS_PATH=build-platform-generators/bin --preset emscripten -DSLANG_SLANG_LLVM_FLAVOR=DISABLE
+ cmake --build --preset emscripten --config Release --target slang-wasm
+ exit 0
+ fi
+
if [[ "${{ matrix.os }}" == "windows" && "${{ matrix.config }}" != "release" && "${{ matrix.config }}" != "releaseWithDebugInfo" ]]; then
echo "Please see ci.yml for the steps to make non-release builds work on Windows" >&2
exit 1
@@ -160,13 +182,6 @@ jobs:
- name: Package Slang
id: package
run: |
- # Package main binaries
- cpack --preset "$config" -G ZIP
- cpack --preset "$config" -G TGZ
- # Package debug info
- cpack --preset "$config-debug-info" -G ZIP
- cpack --preset "$config-debug-info" -G TGZ
-
triggering_ref=${{ github.ref_name }}
if [[ $triggering_ref =~ ^v[0-9] ]]; then
version=${triggering_ref#v}
@@ -175,6 +190,25 @@ jobs:
fi
base=slang-${version}-${{matrix.os}}-${{matrix.platform}}
+ # WASM packaging
+ if [[ "${{ matrix.platform }}" == "wasm" ]]; then
+ base=slang-${version}-${{matrix.platform}}
+ mkdir -p "${base}"
+ cp build.em/Release/bin/slang-wasm.wasm "${base}/slang-wasm.wasm"
+ cp build.em/Release/bin/slang-wasm.js "${base}/slang-wasm.js"
+ cp build.em/Release/bin/interface.d.ts "${base}/interface.d.ts"
+ (cd "${base}" && zip -r "../${base}.zip" .)
+ echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ # Package main binaries
+ cpack --preset "$config" -G ZIP
+ cpack --preset "$config" -G TGZ
+ # Package debug info
+ cpack --preset "$config-debug-info" -G ZIP
+ cpack --preset "$config-debug-info" -G TGZ
+
# Move main packages
mv "$(pwd)/build/dist-${config}/slang.zip" "${base}.zip"
echo "SLANG_BINARY_ARCHIVE_ZIP=${base}.zip" >> "$GITHUB_OUTPUT"