Repository navigation
73 lines (66 loc) · 3.22 KB
/
Copy pathrelease-please.yaml
File metadata and controls
73 lines (66 loc) · 3.22 KB
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
name: 🚀 Release Please
# Cuts marketplace releases with release-please (release-please-config.json and
# .release-please-manifest.json). Each push to main updates one reviewable release PR that
# bumps `.metadata.version` in the marketplace manifest. Merging that PR tags `vX.Y.Z` and
# publishes the GitHub release with its notes. Per-plugin versions and changelogs stay
# author-maintained and are enforced by CI, not by this workflow.
on:
push:
branches: [main]
# One release run at a time, and never cancel one in progress: a cancelled run could leave
# a merged release PR untagged. A newer queued push replaces an older queued one, which is
# safe because every run reads the current state of main.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions: {}
jobs:
release:
name: Tag and publish a merged release
runs-on: ubuntu-latest
# Creating the release creates the `vX.Y.Z` tag. Only the organization's release Apps may
# create `v*` tags (the "Restrict release tag creation" organization ruleset), so this step
# uses the App token, not the workflow token. The token's `pull-requests: write` lets
# release-please relabel the merged release PR as `autorelease: tagged` and comment the
# release link; without it, the next run would find the PR still pending and try to release
# it again. No workflow here runs on tags or releases, so an App-created release starts nothing.
permissions: {}
timeout-minutes: 10
steps:
- name: 🔑 Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write # create the vX.Y.Z tag and the GitHub release
permission-pull-requests: write # relabel and comment on the merged release PR
- name: 🏷️ Tag and publish a merged release PR
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
with:
token: ${{ steps.app-token.outputs.token }}
skip-github-pull-request: true
release-pr:
name: Open or update the release PR
# Runs after the release job, because release-please refuses to open the next release PR
# while a merged release PR is still untagged.
needs: release
runs-on: ubuntu-latest
permissions: {}
timeout-minutes: 10
steps:
- name: 🔑 Generate GitHub App token
id: app-token
# A PR opened with the workflow token does not start CI, so the release PR could
# never pass its required checks. An App-authored PR does.
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: 📝 Open or update the release PR
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
with:
token: ${{ steps.app-token.outputs.token }}
skip-github-release: true