0.2.1 #67
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
name: Node.js CI | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download Boost | |
run: | | |
wget --progress=dot:mega https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz | |
mkdir -p ./contrib/boost-sdk | |
tar zxf 'boost_1_76_0.tar.gz' -C './contrib/boost-sdk' --strip-components=1 | |
- name: Build Boost | |
run: | | |
docker run --rm -i \ | |
--env EMSCRIPTEN=/emsdk/upstream/emscripten \ | |
-v $(pwd):/src emscripten/emsdk:2.0.20 ./bin/build-boost-emscripten.sh | |
- name: Build monero-core-js (wasm) | |
run: | | |
docker run --rm -i \ | |
--env EMSCRIPTEN=/emsdk/upstream/emscripten \ | |
--env BUILD=production \ | |
--env WASM=1 \ | |
-v $(pwd):/src emscripten/emsdk:2.0.20 ./bin/build-emcpp.sh | |
- name: Build monero-core-js (asm) | |
run: | | |
docker run --rm -i \ | |
--env EMSCRIPTEN=/emsdk/upstream/emscripten \ | |
--env BUILD=production \ | |
--env WASM=0 \ | |
-v $(pwd):/src emscripten/emsdk:2.0.20 ./bin/build-emcpp.sh | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: wasm | |
path: | | |
build/MoneroCoreJS.js | |
build/MoneroCoreJS.asm.js | |
build/MoneroCoreJS.wasm | |
test: | |
needs: build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wasm | |
path: build | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- run: npm ci | |
- run: npm test | |
publish: | |
needs: test | |
runs-on: ubuntu-20.04 | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wasm | |
path: build | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
registry-url: https://npm.pkg.github.com/ | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |