Skip to content

build

build #7

Workflow file for this run

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