-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.45 KB
/
release-it.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: Publishing & Versioning
on:
push:
branches:
- 'main'
- 'release/[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
release:
needs: build
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set repository-specific username/email configuration
run: |
git config user.name "Zhang Jia Rong"
git config user.email [email protected]
- name: Import personal GPG key
run: echo -n "${GPG_PRIVATE_KEY}" | base64 --decode | gpg --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Use GPG signing key with Git (and GitHub)
run: git config user.signingkey ${GPG_KEY_ID}
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- if: ${{ startsWith(github.ref_name, 'release/') }}
run: npm run release -- --preRelease=rc --npm.tag=next
- if: github.ref_name == 'master'
run: npm run release