Skip to content

v0.9.1

v0.9.1 #20

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
id-token: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v2
with:
files: |
dprint_plugin/deployment/plugin.wasm
dprint_plugin/deployment/schema.json
- name: Publish crates
run: cargo publish -p malva
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- 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 standalone_wasm
cp README.md standalone_wasm/pkg/README.md
- name: Modify package name
shell: pwsh
run: |
$packageJson = Get-Content standalone_wasm/pkg/package.json | ConvertFrom-Json
$packageJson.name = "malva"
$packageJson | ConvertTo-Json | Set-Content standalone_wasm/pkg/package.json
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- name: Publish npm package
run: |
cp target/wasm32-unknown-unknown/release/dprint_plugin_malva.wasm dprint_plugin/deployment/npm/plugin.wasm
cd dprint_plugin/deployment/npm && npm publish --provenance --access public
cd ../../../standalone_wasm/pkg && npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}