Skip to content

mr-manuel is building wasm file #4361

mr-manuel is building wasm file

mr-manuel is building wasm file #4361

Workflow file for this run

name: build-wasm
run-name: ${{ github.actor }} is building wasm file
on:
push:
paths-ignore:
- '**/README.md'
jobs:
build-wasm-file:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up environment variables from "scripts/.env" file
run: |
if [ -f "scripts/.env" ]; then
export $(grep -v '^#' "scripts/.env" | xargs)
else
echo "## scripts/.env file not found!"
exit 1
fi
echo "EMSCRIPTEN=$EMSCRIPTEN" >> $GITHUB_ENV
echo "QT_VERSION=$QT_VERSION" >> $GITHUB_ENV
echo "OUTPUTDIR=$OUTPUTDIR" >> $GITHUB_ENV
- name: Show fetched environment variables
run: |
echo "Loaded environment variables from \"scripts/.env\" file:"
echo "EMSCRIPTEN: ${{ env.EMSCRIPTEN }}"
echo "QT_VERSION: ${{ env.QT_VERSION }}"
echo "OUTPUTDIR: ${{ env.OUTPUTDIR }}"
- name: Check for a cached version
uses: actions/cache@v4
id: cached_qt_emscripten
with:
path: |
${{ env.OUTPUTDIR }}
# Adding version as cache key
key: ${{ runner.os }}-qt-${{ env.QT_VERSION }}-em-${{ env.EMSCRIPTEN }}-libegl1
- name: Install requirements
if: steps.cached_qt_emscripten.outputs.cache-hit != true
run: |
bash scripts/build-wasm-install-requirements.sh
- name: Install libraries needed for building the wasm
if: steps.cached_qt_emscripten.outputs.cache-hit == true
run: |
sudo apt-get update -yq
sudo apt-get install -y libegl1
- name: Build WebAssembly
run: |
bash scripts/build-wasm.sh
- name: Upload ZIP file
uses: actions/upload-artifact@v4
with:
name: venus-webassembly
path: build-wasm
retention-days: 5
- name: ZIP wasm files for release
if: startsWith(github.ref, 'refs/tags/')
run: |
cd build-wasm
zip -r ../venus-webassembly.zip wasm
- name: Release tagged wasm files
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: venus-webassembly.zip