Skip to content

release: Max updates 0.2.6 (#1449) #23

release: Max updates 0.2.6 (#1449)

release: Max updates 0.2.6 (#1449) #23

---
name: 🕹️ Editor - Build & Deploy Playground (WebAssembly)
on:
push:
branches:
- main
paths:
- 'compiler/src/**'
- 'compiler/std/**'
- 'compiler/tools/**'
- 'editor/**'
- 'compiler/tests/*/editor-selected/**'
- '.github/workflows/editor-playground-deploy.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: editor-playground-${{ github.ref }}
cancel-in-progress: true
jobs:
build-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install build dependencies (tcc)
run: |
set -e
sudo apt-get update
sudo apt-get install -y tcc
- name: Cache Emscripten SDK
id: emsdk-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/emsdk
key: emsdk-${{ runner.os }}-v1
- name: Install Emscripten SDK
run: |
set -e
if [ ! -x "$HOME/emsdk/emsdk" ]; then
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "$HOME/emsdk"
fi
cd "$HOME/emsdk"
if [ ! -d "upstream/emscripten" ]; then
./emsdk install latest
./emsdk activate latest
else
echo "Emscripten SDK restored from cache - skipping install"
fi
. ./emsdk_env.sh
echo "$EMSDK" >> "$GITHUB_PATH"
echo "$EMSDK/upstream/emscripten" >> "$GITHUB_PATH"
echo "EMSDK=$EMSDK" >> "$GITHUB_ENV"
echo "EM_CONFIG=$EMSDK/.emscripten" >> "$GITHUB_ENV"
- name: Verify editor source files are present
run: |
set -eu
missing=0
for f in editor/src/page.salam editor/src/app.salam editor/build.sh editor/assets/logo.svg editor/assets/fonts/Vazirmatn-Variable.woff2; do
if [ ! -f "$f" ]; then
echo "::error::missing editor source file: $f (is it committed? editor/* is gitignored except sources)"
missing=1
fi
done
[ "$missing" -eq 0 ] || exit 1
- name: Build native compiler + WebAssembly playground bundle
run: |
set -e
emcc --version
cd compiler
sh tools/bash/update-playground.sh
- name: Verify generated editor assets
run: |
set -eu
missing=0
for f in editor/salam-wa.js editor/salam-wa.wasm editor/salam-wa.data \
editor/src/examples_data.salam editor/index.html; do
if [ ! -f "$f" ]; then
echo "::error::missing generated asset: $f"
missing=1
fi
done
[ "$missing" -eq 0 ] || exit 1
echo "==> Editor directory to be published:"
ls -l editor/
- name: Configure GitHub Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload playground artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: editor
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0