Merge pull request #160 from kcl-lang/chore-bump-lib-to-0.10.7 #180
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-test | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "wasm/**" | |
- ".github/workflows/wasm-test.yaml" | |
workflow_dispatch: | |
jobs: | |
test-and-release: | |
name: Test and Release | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
# Notes: this defaults only apply on run tasks. | |
defaults: | |
run: | |
working-directory: "wasm" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install rust nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.79 | |
override: true | |
components: clippy, rustfmt | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22 | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: Rust example e2e tests | |
run: cd examples/rust && cargo test -r | |
- name: Go example e2e tests | |
run: cd examples/go && go mod tidy && go run main.go | |
- name: Node.js example e2e tests | |
run: cd examples/node && npm install && npm run build | |
- name: Browser example e2e tests | |
run: cd examples/browser && npm install && npm run build | |
- name: Publish Dry Run | |
if: "startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-')" | |
# Since this command will not exit with non-zero code when file missing, | |
# we need to check the output manually. | |
run: | | |
npm publish --access public --provenance --dry-run | |
- name: Publish | |
if: "startsWith(github.ref, 'refs/tags/')" | |
run: | | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | |
npm publish --access public --provenance | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |