-
-
Notifications
You must be signed in to change notification settings - Fork 18
53 lines (50 loc) · 1.35 KB
/
build.yml
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
name: build
permissions:
contents: write
repository-projects: write
on:
workflow_dispatch:
branches: [dev]
jobs:
build:
name: build-wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: node
uses: actions/setup-node@v4
with:
node-version: "20"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
git pull
cur=$(git rev-parse --abbrev-ref HEAD)
echo "current branch is $cur."
if [ "$cur" != "dev" ]; then
echo "err : not dev branch"
exit 1
fi
git config user.name github-actions
git config user.email github-actions@github.com
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk/
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
emcc -v
cd ..
git submodule update --init --recursive
make clean
npm install -D @types/node
npm run build:mcl_c.js
npm run build:browser
npm test
sha256sum src/mcl_c.js browser/mcl.js
git add -f src/mcl_c.js browser/mcl.js
changes=$(git diff --staged --numstat | wc -l)
if [[ $changes -gt 0 ]]
then
git commit -m "build: mcl_c.js is generated by GitHub Action"
git push origin dev
fi