wasmoon 2.0 #127
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup EMSDK | |
uses: mymindstorm/setup-emsdk@v14 | |
- name: Use Node.js 22.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Run lint (no fix) | |
run: npm run lint:nofix | |
- name: Build WASM | |
run: npm run build:wasm | |
- name: Build project | |
run: npm run build | |
- name: Run tests | |
run: npm test | |
- name: Run Lua tests | |
run: npm run luatests | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifact | |
path: | | |
package.json | |
package-lock.json | |
dist/ | |
bin/ | |
LICENSE | |
publish_npm: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifact | |
path: build-artifact | |
- name: Restore build artifact | |
run: cp -r build-artifact/* . | |
- name: Publish to npm | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
publish_jsr: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifact | |
path: build-artifact | |
- name: Restore build artifact | |
run: cp -r build-artifact/* . | |
- name: Generate jsr.json from package.json | |
run: | | |
node -e "const pkg = require('./package.json'); \ | |
const jsr = { \ | |
name: '@ceifa/' + pkg.name, \ | |
version: pkg.version, \ | |
exports: pkg.main, \ | |
include: ['dist/**/*', 'bin/**/*'] | |
}; \ | |
require('fs').writeFileSync('jsr.json', JSON.stringify(jsr, null, 2));" | |
- name: Publish to JSR | |
run: npx jsr publish |