Skip to content

Add Script, Language, and Direction classes #408

Add Script, Language, and Direction classes

Add Script, Language, and Direction classes #408

Workflow file for this run

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@v6
with:
submodules: true
- name: Setup cache
id: cache-system-libraries
uses: actions/cache@v5
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{runner.os}}
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v16
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: Check docs
run: make doc
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: wasm
path: |
dist/harfbuzz.js
dist/harfbuzz.wasm
dist/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@v8
with:
name: wasm
path: dist
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24.x"
- name: Detect prerelease
id: prerelease
run: |
if [[ "${{ github.ref_name }}" == *-* ]]; then
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
echo "npm_tag=next" >> "$GITHUB_OUTPUT"
else
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
echo "npm_tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish on NPM
run: npm publish --provenance --access public --tag ${{ steps.prerelease.outputs.npm_tag }}
- name: Extract release notes from annotated tag message
id: release_notes
run: |
# GH checkout action doesn't preserve tag annotations, we must fetch them
# https://github.com/actions/checkout/issues/290
git fetch --no-recurse-submodules --tags --force
# Dump tag message body to temporary .md file
echo "$(git tag -l --format='%(contents:body)' ${{ github.ref_name }})" > "${{ runner.temp }}/release_body.md"
- name: Create GitHub release
id: create_release
run: |
if gh release view ${{ github.ref_name }}; then
exit 0
fi
notes="--notes-file ${{ runner.temp }}/release_body.md"
# If the notes file is empty, use --generate-notes instead
if ! grep -q "[^[:space:]]" "${{ runner.temp }}/release_body.md"; then
notes="--generate-notes"
fi
prerelease=""
if [ "${{ steps.prerelease.outputs.is_prerelease }}" = true ]; then
prerelease="--prerelease"
fi
gh release create ${{ github.ref_name }} \
--title ${{ github.ref_name }} \
$notes \
$prerelease
- name: Populate release
run: |
gh release upload ${{ github.ref_name }} dist/harfbuzz.js dist/harfbuzz.wasm dist/harfbuzz-subset.wasm --clobber