modified build-docker script #45
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: Build and Test | |
on: | |
release: | |
types: [ published ] | |
push: | |
branches: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: get release version | |
id: pre-step | |
shell: bash | |
run: echo "release-version=$(echo ${GITHUB_REF:10})" >> $GITHUB_OUTPUT | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- name: Cache npm | |
uses: actions/cache@v4 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Clone git submodule (WebARKitLib) | |
run: git submodule update --init | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: | | |
docker run -dit --name emscripten-nft-marker-creator-app -v $(pwd):/src emscripten/emsdk:3.1.69 bash | |
docker exec emscripten-nft-marker-creator-app npm run build-local | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: | | |
build | |
!build/libar.o | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
build/NftMarkerCreator.min.js | |
build/NftMarkerCreator_ES6_wasm.js | |
build/NftMarkerCreator_wasm.js | |
build/NftMarkerCreator_wasm.thread.js | |
src/NFTMarkerCreator.js |