v0.1.1 #4
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: write | |
id-token: write | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rustup target add wasm32-unknown-unknown | |
- run: | | |
cargo build --release -p dprint_plugin_malva --target wasm32-unknown-unknown | |
cp target/wasm32-unknown-unknown/release/dprint_plugin_malva.wasm dprint_plugin/deployment/plugin.wasm | |
- name: Publish dprint plugin | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dprint_plugin/deployment/plugin.wasm | |
dprint_plugin/deployment/schema.json | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Build standalone wasm | |
run: | | |
wasm-pack build --target web --no-typescript standalone_wasm | |
jq '.name = "malva"' standalone_wasm/pkg/package.json > standalone_wasm/pkg/package.json | |
cp README.md standalone_wasm/pkg/README.md | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://registry.npmjs.org" | |
- run: npm install -g npm | |
- name: Publish npm package | |
run: cd standalone_wasm/pkg && npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |