File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 37
37
needs : [build, lint]
38
38
39
39
steps :
40
+ # (1) Create a GitHub App token
41
+ # Note: the Github App must be installed on the repository and included in the bypass list of the ruleset.
40
42
- uses : actions/create-github-app-token@v1
41
43
id : app-token
42
44
with :
@@ -46,12 +48,15 @@ jobs:
46
48
- name : Checkout
47
49
uses : actions/checkout@v4
48
50
with :
51
+ # (2) Use the GitHub App token to init the repository
49
52
token : ${{ steps.app-token.outputs.token }}
53
+ # (3) Fetch all history so that release-it can determine the version
50
54
fetch-depth : 0
51
55
52
56
- name : Setup
53
57
uses : ./.github/actions/setup
54
58
59
+ # (3) Configure Git user
55
60
- name : Configure Git User
56
61
run : |
57
62
git config --global user.name "${GITHUB_ACTOR}"
60
65
- name : Release
61
66
run : yarn release
62
67
env :
68
+ # (4) Make GITHUB_TOKEN available to release-it but use the GitHub App token
63
69
GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
64
70
Original file line number Diff line number Diff line change
1
+ name : release
2
+
3
+ on : workflow_dispatch
4
+
5
+ jobs :
6
+ build :
7
+ name : Build
8
+ runs-on : ubuntu-latest
9
+
10
+ steps :
11
+ - name : Checkout
12
+ uses : actions/checkout@v4
13
+
14
+ - name : Setup
15
+ uses : ./.github/actions/setup
16
+
17
+ - name : Build
18
+ run : yarn build
19
+
20
+ lint :
21
+ name : Lint
22
+ runs-on : ubuntu-latest
23
+
24
+ steps :
25
+ - name : Checkout
26
+ uses : actions/checkout@v4
27
+
28
+ - name : Setup
29
+ uses : ./.github/actions/setup
30
+
31
+ - name : Lint
32
+ run : yarn lint
33
+
34
+ release :
35
+ name : Release
36
+ runs-on : ubuntu-latest
37
+ needs : [build, lint]
38
+
39
+ # (1) Configure GITHUB_TOKEN with write permissions
40
+ permissions :
41
+ contents : write
42
+
43
+ steps :
44
+ - name : Checkout
45
+ uses : actions/checkout@v4
46
+ with :
47
+ # (2) Fetch all history so that release-it can determine the version
48
+ fetch-depth : 0
49
+
50
+ - name : Setup
51
+ uses : ./.github/actions/setup
52
+
53
+ # (3) Configure Git user
54
+ - name : Configure Git User
55
+ run : |
56
+ git config --global user.name "${GITHUB_ACTOR}"
57
+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
58
+
59
+ - name : Release
60
+ run : yarn release
61
+ env :
62
+ # (4) Make GITHUB_TOKEN available to release-it
63
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64
+
You can’t perform that action at this time.
0 commit comments