-
Notifications
You must be signed in to change notification settings - Fork 17
/
release-please.yml
64 lines (58 loc) · 1.74 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
name: Release Please
on:
push:
branches:
{{#each branches}}
- {{.}}
{{/each}}
{{#each releaseBranches}}
- {{.}}
{{/each}}
permissions:
contents: write
pull-requests: write
jobs:
release-please:
outputs:
pr: $\{{ steps.release.outputs.pr }}
release: $\{{ steps.release.outputs.release }}
{{> setupJob }}
- name: Release Please
id: release
run: npx --offline template-oss-release-please $\{{ github.ref_name }}
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
post-pr:
needs: release-please
if: needs.release-please.outputs.pr
runs-on: ubuntu-latest
outputs:
ref: $\{{ steps.ref.outputs.branch }}
steps:
- name: Output ref
id: ref
run: echo "::set-output name=branch::$\{{ fromJSON(needs.release-please.outputs.pr).headBranchName }}"
{{> setupGit checkout=(obj ref="${{ steps.ref.outputs.branch }}" fetch-depth=0)}}
{{> setupNode}}
{{> setupDeps}}
- name: Post pull request actions
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
run: |
{{rootNpmPath}} run rp-pull-request --ignore-scripts --if-present -ws -iwr
git commit -am "chore: post pull request" || true
git push
release-test:
needs: post-pr
if: needs.post-pr.outputs.ref
uses: ./.github/workflows/release.yml
with:
ref: $\{{ needs.post-pr.outputs.ref }}
post-release:
needs: release-please
{{> setupJob jobIf="needs.release-please.outputs.release" }}
- name: Post release actions
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
run: |
{{rootNpmPath}} run rp-release --ignore-scripts --if-present -ws -iwr