wasm-tools: load new tag format #19
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: wasm-tools | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
workflow_dispatch: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
- name: npm install | |
run: npm install | |
- name: npm run build | |
run: npm run package | |
env: | |
NODE_OPTIONS: --openssl-legacy-provider | |
- name: upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: setup-wasm-tools | |
path: dist/wasm-tools/setup/index.js | |
setup-default: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve saved Github action | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-wasm-tools | |
path: dist/wasm-tools/setup/ | |
- name: setup wasm-tools | |
uses: ./wasm-tools/setup/ | |
with: | |
github_token: ${{ github.token }} | |
- name: verify wasm-tools setup | |
run: wasm-tools --version | |
setup-version: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
version: ["1.0.43", "1.200.0"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve saved Github action | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-wasm-tools | |
path: dist/wasm-tools/setup/ | |
- name: setup wasm-tools | |
uses: ./wasm-tools/setup/ | |
with: | |
version: ${{ matrix.version }} | |
github_token: ${{ github.token }} | |
- name: wasm-tools setup successful | |
if: ${{ contains(env.WASM_TOOLS_VERSION, matrix.version) }} | |
run: echo "wasm-tools setup successful" | |
- name: wasm-tools setup failed | |
if: ${{ !contains(env.WASM_TOOLS_VERSION, matrix.version) }} | |
run: | | |
echo "expected version: ${{ matrix.version }}, found: ${{ env.WASM_TOOLS_VERSION }}" | |
exit 1 | |
setup-v-version: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
version: ["1.0.43", "1.200.0"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve saved Github action | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-wasm-tools | |
path: dist/wasm-tools/setup/ | |
- name: setup wasm-tools with v-prefixed version | |
uses: ./wasm-tools/setup/ | |
with: | |
version: v${{ matrix.version }} | |
github_token: ${{ github.token }} | |
- name: wasm-tools setup successful | |
if: ${{ contains(env.WASM_TOOLS_VERSION, matrix.version) }} | |
run: echo "wasm-tools setup successful" | |
- name: wasm-tools setup failed | |
if: ${{ !contains(env.WASM_TOOLS_VERSION, matrix.version) }} | |
run: | | |
echo "expected version: ${{ matrix.version }}, found: ${{ env.WASM_TOOLS_VERSION }}" | |
exit 1 |