-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.6 KB
/
publish.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Publish
on:
push:
tags:
- 'v*'
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Just Command Runner
uses: extractions/setup-just@v1
- name: Install Wasm Pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
run: just build
- name: Set type="module" for package.json
run: |
npm i -g json
json -I -f ./pkg/package.json -e "this.type=\"module\""
- name: Publish to NPM
run: |
cd ./pkg
npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
create-release:
name: Create a release
runs-on: ubuntu-latest
needs: publish
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Create Release Notes
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});