Use FinalizationRegistry for automatic WASM memory cleanup #338
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: [ "*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| id-token: write | |
| contents: write | |
| env: | |
| EM_VERSION: 4.0.13 | |
| EM_CACHE_FOLDER: 'emsdk-cache' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Setup cache | |
| id: cache-system-libraries | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{env.EM_CACHE_FOLDER}} | |
| key: ${{env.EM_VERSION}}-${{runner.os}} | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: ${{env.EM_VERSION}} | |
| actions-cache-folder: ${{env.EM_CACHE_FOLDER}} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Build | |
| run: make | |
| - name: Run tests | |
| run: make test | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wasm | |
| path: | | |
| harfbuzz.js | |
| harfbuzz.wasm | |
| harfbuzz-subset.wasm | |
| if-no-files-found: error | |
| release: | |
| name: Create and populate release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: contains(github.ref, 'refs/tags/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: wasm | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24.x' | |
| - name: Publish on NPM | |
| run: npm publish --provenance --access public | |
| - name: Check for release | |
| id: create_release | |
| run: | | |
| if ! gh release view ${{ github.ref_name }}; then | |
| gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes | |
| fi | |
| - name: Populate release | |
| run: | | |
| gh release upload ${{ github.ref_name }} harfbuzz.js harfbuzz.wasm harfbuzz-subset.wasm --clobber |