blammit is building wasm file #6622
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | name: build-wasm | |
| run-name: ${{ github.actor }} is building wasm file | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**/README.md' | |
| jobs: | |
| build-wasm-file: | |
| runs-on: ubuntu-24.04 | |
| 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-versions | |
| with: | |
| path: | | |
| # Cache the Qt and emscripten installation | |
| ${{ env.OUTPUTDIR }} | |
| # Adding version as cache key | |
| key: ${{ runner.os }}__qt-${{ env.QT_VERSION }}__em-${{ env.EMSCRIPTEN }}__libegl1 | |
| - name: Install requirements (cache miss) | |
| if: steps.cached-versions.outputs.cache-hit != 'true' | |
| run: | | |
| bash scripts/build-wasm-install-requirements.sh | |
| - name: Install libraries needed for building the wasm (cache hit) | |
| if: steps.cached-versions.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_files_to_copy | |
| retention-days: 5 | |
| - name: Release - ZIP wasm files | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| cd build-wasm_files_to_copy | |
| zip -r ../venus-webassembly.zip wasm | |
| - name: Release - Create release with wasm files | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: venus-webassembly.zip |