-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.78 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
65
66
67
68
name: "Publish"
on:
workflow_dispatch:
inputs:
type:
description: "version type:"
required: true
type: choice
default: "minor"
options:
- patch
- minor
- major
custom_version:
description: 'custom version: x.y.z (without "v")'
required: false
run-name: Publish ${{ inputs.type }} ${{ inputs.custom_version }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
always-auth: true
registry-url: "https://registry.npmjs.org"
- name: Install wasm target
run: |
rustup target add wasm32-wasi
- run: npm run test
- run: npm run build
- name: Set Git credentials
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Bump by version type
if: ${{ !github.event.inputs.custom_version }}
run: npm version ${{ github.event.inputs.type }} --no-commit-hooks -m "v%s"
- name: Bump by custom version
if: ${{ github.event.inputs.custom_version }}
run: npm version ${{ github.event.inputs.custom_version }} --no-commit-hooks -m "v%s"
- name: Pushing changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Publishing release
run: npm publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}