-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
123 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: build | ||
|
||
permissions: | ||
contents: write | ||
repository-projects: write | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: [dev] | ||
|
||
jobs: | ||
build: | ||
name: bls-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 -C src | ||
cd browser | ||
npm install -D webpack webpack-cli | ||
npx webpack | ||
cd .. | ||
npm test | ||
sha256sum src/bls_c.js browser/bls.js | ||
git add -f src/bls_c.js browser/bls.js | ||
changes=$(git diff --staged --numstat | wc -l) | ||
if [[ $changes -gt 0 ]] | ||
then | ||
git commit -m "build: bls_c.js is generated by GitHub Action" | ||
git push origin dev | ||
fi |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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