-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (64 loc) · 1.87 KB
/
release-please.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
69
70
# 如果是开发合并请求到主干,则会根据约定式提交创建一个 releasePR,是一个新版本合并请求。
# 如果是新版本合并请求合并到主干,则会触发版本发布到 npm/github 等仓库。
name: release please
on:
push:
branches:
- v*.x
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
default-branch: ${{ github.ref_name }}
test-coverage:
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.release_created
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-nvm
- run: npm ci
- run: npm run test:coverage
- uses: codacy/codacy-coverage-reporter-action@v1
with:
api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: coverage/lcov.info
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs: test-coverage
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-nvm
- run: npm ci
- run: npm run build
- uses: FrontEndDev-org/publish-node-package-action@v1
with:
target: npm
token: ${{ secrets.NPM_TOKEN }}
- uses: FrontEndDev-org/npm-mirror-sync-action@v1
publish-github:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs: test-coverage
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-nvm
- run: npm ci
- run: npm run build
- uses: FrontEndDev-org/publish-node-package-action@v1
with:
target: github