Skip to content

Fix unmatch close function call #105

Fix unmatch close function call

Fix unmatch close function call #105

Workflow file for this run

name: WebAssembly
on:
pull_request_target:
branches:
- master
types:
- closed
workflow_dispatch:
branches:
- master
jobs:
wasm-deploy:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Verify if the JS or HTML or ELF executable files has been modified
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
assets/html/index.html
assets/js/pre.js
build/*.elf
- name: install emcc
if: ${{ steps.changed-files.outputs.any_modified == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
git checkout 3.1.51
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
echo "$PATH" >> $GITHUB_PATH
shell: bash
- name: build with emcc and move application files to /tmp
if: ${{ steps.changed-files.outputs.any_modified == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: |
make CC=emcc ENABLE_GDBSTUB=0 ENABLE_SDL=1
mkdir /tmp/rv32emu-demo
mv assets/html/index.html /tmp/rv32emu-demo
mv assets/js/coi-serviceworker.min.js /tmp/rv32emu-demo
mv build/elf_list.js /tmp/rv32emu-demo
mv build/rv32emu.js /tmp/rv32emu-demo
mv build/rv32emu.wasm /tmp/rv32emu-demo
mv build/rv32emu.worker.js /tmp/rv32emu-demo
ls -al /tmp/rv32emu-demo
- name: Check out the rv32emu-demo repo
if: ${{ steps.changed-files.outputs.any_modified == 'true' ||
github.event_name == 'workflow_dispatch'}}
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
repository: sysprog21/rv32emu-demo
- name: Create local changes
if: ${{ steps.changed-files.outputs.any_modified == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: |
mv /tmp/rv32emu-demo/index.html .
mv /tmp/rv32emu-demo/coi-serviceworker.min.js .
mv /tmp/rv32emu-demo/elf_list.js .
mv /tmp/rv32emu-demo/rv32emu.js .
mv /tmp/rv32emu-demo/rv32emu.wasm .
mv /tmp/rv32emu-demo/rv32emu.worker.js .
- name: Commit files
if: ${{ steps.changed-files.outputs.any_modified == 'true' ||
github.event_name == 'workflow_dispatch'}}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --all
git commit -m "Add changes"
- name: Push changes
if: ${{ steps.changed-files.outputs.any_modified == 'true' ||
github.event_name == 'workflow_dispatch'}}
uses: ad-m/github-push-action@master
with:
repository: sysprog21/rv32emu-demo
github_token: ${{ secrets.RV32EMU_DEMO_TOKEN }}
branch: main