diff --git a/.github/workflows/wasm-npm-publish.yml b/.github/workflows/wasm-npm-publish.yml new file mode 100644 index 0000000..971b917 --- /dev/null +++ b/.github/workflows/wasm-npm-publish.yml @@ -0,0 +1,28 @@ +name: Wasm NPM Publish + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install wasm-pack + run: cargo install wasm-pack + - name: Build wasm + run: wasm-pack build --target web --out-dir si-emu-pkg --release + - name: Install Node.js + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - name: Move to package directory + run: cd si-emu-pkg + - name: Publish to NPM + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.github/workflows/wasm-publish.yml b/.github/workflows/wasm-publish.yml deleted file mode 100644 index c81db3b..0000000 --- a/.github/workflows/wasm-publish.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Wasm CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [ 14.x, 16.x, 18.x ] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3 - - name: Install wasm-pack - run: cargo install wasm-pack - - name: Build wasm - run: wasm-pack build --target web --out-dir si-web-react/si-emu-pkg --release