Skip to content

feat: publish as @frsource/box3d-wasm, track Box3D via git dependency, emit types #10

feat: publish as @frsource/box3d-wasm, track Box3D via git dependency, emit types

feat: publish as @frsource/box3d-wasm, track Box3D via git dependency, emit types #10

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
cache:
name: CI cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
lint:
name: lint
runs-on: ubuntu-latest
needs: cache
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm lint
build-and-release:
name: build and release
runs-on: ubuntu-latest
needs: [cache, lint]
concurrency:
group: release
permissions:
contents: write # push release commit/tag, create GitHub release
issues: write # comment on released issues
pull-requests: write # comment on released PRs
id-token: write # npm trusted publishing (OIDC) + provenance
steps:
- uses: actions/checkout@v7
with:
# pulls all commits (needed for semantic release to correctly version)
fetch-depth: '0'
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
# No actions-cache-folder: that would put emsdk inside the workspace, and
# emcc --emit-tsd runs tsc from the emsdk directory, where TypeScript 6
# refuses (TS5112) once it finds a tsconfig.json in a parent directory.
- uses: mymindstorm/setup-emsdk@v16
with:
version: 6.0.2
# also fetches the pinned Box3D source: the @erincatto/box3d git dependency
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm test
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
- name: release package
if: ${{ success() && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
run: pnpm release:ci
env:
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}