-
Notifications
You must be signed in to change notification settings - Fork 46
95 lines (84 loc) · 2.3 KB
/
build.yml
File metadata and controls
95 lines (84 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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: NPM install
run: npm install
- name: Run tests
run: npm test
- name: Test hb.wasm
run: node examples/hbjs.example.node.js
- name: Test hb-subset.wasm
run: node examples/hb-subset.example.node.js
- name: Archive artifacts
uses: actions/upload-artifact@v6
with:
name: wasm
path: |
hb.js
hb.wasm
hb-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 }} hb.js hb.wasm hb-subset.wasm --clobber