-
-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (43 loc) · 1.4 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: rustup target add wasm32-unknown-unknown
- run: |
cargo build --release -p dprint_plugin_yaml --target wasm32-unknown-unknown
cp target/wasm32-unknown-unknown/release/dprint_plugin_yaml.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: Publish crates
run: |
if ! git show --exit-code -G^version yaml_parser/Cargo.toml; then
cargo publish -p yaml_parser
fi
cargo publish -p pretty_yaml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- 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_yaml.wasm dprint_plugin/deployment/npm/plugin.wasm
cd dprint_plugin/deployment/npm
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}