-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (41 loc) · 1.45 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
47
48
49
50
51
name: Release
on:
pull_request:
types: [opened, synchronize, reopened]
release:
# "released" events are emitted either when directly be released or be edited from pre-released.
types: [prereleased, released]
jobs:
deploy:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4
with:
# https://nodejs.org/en/about/previous-releases
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: install and build
run: |
pnpm install
pnpm build
- name: update version
if: github.event_name == 'release'
run: |
git config user.email "dummy@dummy"
git config user.name "dummy"
pnpm version from-git --allow-same-version --no-git-tag-version || true
- name: deploy
run: pnpm publish --access=public --no-git-checks --recursive
if: github.event_name == 'release' && !github.event.release.prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: deploy (dry-run)
run: pnpm publish --access=public --no-git-checks --dry-run --recursive
if: github.event_name != 'release' || github.event.release.prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}