-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (53 loc) · 1.4 KB
/
publish_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
name: Publish
on:
push:
branches:
- main
- release/1.x
workflow_dispatch:
concurrency: release
permissions:
contents: write
issues: write
checks: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
packages: write
pull-requests: write
id-token: write
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.BOT_ID }}
private-key: ${{ secrets.BOT_SK }}
- uses: actions/checkout@v3
with:
token: ${{ steps.app-token.outputs.token }}
# semantic-release needs node 20
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm install
- name: "Build"
run: npm run build
- name: "Semantic release"
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Merge Release -> Trunk
uses: devmasx/merge-branch@854d3ac71ed1e9deb668e0074781b81fdd6e771f
if: github.ref == 'refs/heads/release/1.x'
with:
type: now
from_branch: release/1.x
target_branch: main
github_token: ${{ steps.app-token.outputs.token }}