-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (80 loc) · 2.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Publish
on:
pull_request:
types:
- opened
- reopened
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}
jobs:
autoApprove:
if: startsWith(github.head_ref, 'release-auto-')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v4
with:
review-message: 'Auto approve sync PRs to auto merge them'
publish:
if: startsWith(github.head_ref, 'release-auto-')
needs: [autoApprove]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install
- name: Publish
if: startsWith(github.head_ref, 'release-auto-v')
run: |
git config user.name github-actions
git config user.email [email protected]
yarn pub
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish-next
if: startsWith(github.head_ref, 'release-auto-next-v')
run: |
git config user.name github-actions
git config user.email [email protected]
yarn pub-next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Read package.json
id: read-version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- name: send message to webhook
uses: joelwmale/webhook-action@master
with:
url: 'https://hook-rc.pingcode.com/api/flow/w/http/357bdd4f00f34bfab2f878ad3b9e8b48'
body: '{ "version": "${{ steps.read-version.outputs.prop }}", "name": "tethys-pro" }'
autoMerge:
if: startsWith(github.head_ref, 'release-auto-')
needs: [publish]
runs-on: ubuntu-latest
steps:
- id: autoMerge
name: autoMerge
uses: 'pascalgn/[email protected]'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
MERGE_LABELS: ''
MERGE_FORKS: 'false'
MERGE_RETRIES: '20'
MERGE_RETRY_SLEEP: '60000'