@@ -16,22 +16,40 @@ jobs:
16
16
release-please :
17
17
runs-on : ubuntu-latest
18
18
outputs :
19
- prs : ${{ steps.release.outputs.prs }}
19
+ pr : ${{ steps.release.outputs.pr }}
20
+ release : ${{ steps.release.outputs.release }}
20
21
steps :
21
- - uses : google-github-actions/release-please-action@v3
22
- id : release
22
+ - uses : actions/checkout@v3
23
+ - name : Setup git user
24
+ run : |
25
+ git config --global user.email "npm-cli+bot@github.com"
26
+ git config --global user.name "npm CLI robot"
27
+ - uses : actions/setup-node@v3
23
28
with :
24
- command : manifest
29
+ node-version : 16.x
30
+ - name : Update npm to latest
31
+ run : npm i --prefer-online --no-fund --no-audit -g npm@latest
32
+ - run : npm -v
33
+ - run : npm i --ignore-scripts --no-audit --no-fund
34
+ - name : Release Please
35
+ id : release
36
+ run : npx --offline template-oss-release-please
37
+ env :
38
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
39
26
- update-prs :
40
+ post-pr :
27
41
needs : release-please
28
- if : needs.release-please.outputs.prs
42
+ if : needs.release-please.outputs.pr
29
43
runs-on : ubuntu-latest
30
- strategy :
31
- matrix :
32
- pr : ${{ fromJSON(needs.release-please.outputs.prs) }}
44
+ outputs :
45
+ ref : ${{ steps.ref.outputs.branch }}
33
46
steps :
47
+ - name : Output ref
48
+ id : ref
49
+ run : echo "::set-output name=branch::${{ fromJSON(needs.release-please.outputs.pr).headBranchName }}"
34
50
- uses : actions/checkout@v3
51
+ with :
52
+ ref : ${{ steps.ref.outputs.branch }}
35
53
- name : Setup git user
36
54
run : |
37
55
git config --global user.email "npm-cli+bot@github.com"
@@ -42,15 +60,41 @@ jobs:
42
60
- name : Update npm to latest
43
61
run : npm i --prefer-online --no-fund --no-audit -g npm@latest
44
62
- run : npm -v
45
- - name : Update PR ${{ matrix.pr.number }} dependencies and commit
63
+ - run : npm i --ignore-scripts --no-audit --no-fund
64
+ - name : Post pull request actions
46
65
env :
47
66
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
67
run : |
49
- gh pr checkout ${{ matrix.pr.number }}
50
- npm run resetdeps
51
- title="${{ matrix.pr.title }}"
52
- # get the dependency spec from the pr title
53
- # get everything after ': release ' + replace space with @
54
- dep_spec=$(echo "${title##*: release }" | tr ' ' @)
55
- git commit -am "deps: $dep_spec"
68
+ npm run rp-pull-request --ignore-scripts --if-present -ws -iwr
69
+ git commit -am "chore: post pull request" || true
56
70
git push
71
+
72
+ release-test :
73
+ needs : post-pr
74
+ if : needs.post-pr.outputs.ref
75
+ uses : ./.github/workflows/release.yml
76
+ with :
77
+ ref : ${{ needs.post-pr.outputs.ref }}
78
+
79
+ post-release :
80
+ needs : release-please
81
+ if : needs.release-please.outputs.release
82
+ runs-on : ubuntu-latest
83
+ steps :
84
+ - uses : actions/checkout@v3
85
+ - name : Setup git user
86
+ run : |
87
+ git config --global user.email "npm-cli+bot@github.com"
88
+ git config --global user.name "npm CLI robot"
89
+ - uses : actions/setup-node@v3
90
+ with :
91
+ node-version : 16.x
92
+ - name : Update npm to latest
93
+ run : npm i --prefer-online --no-fund --no-audit -g npm@latest
94
+ - run : npm -v
95
+ - run : npm i --ignore-scripts --no-audit --no-fund
96
+ - name : Post release actions
97
+ env :
98
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
99
+ run : |
100
+ npm run rp-release --ignore-scripts --if-present -ws -iwr
0 commit comments