-
Notifications
You must be signed in to change notification settings - Fork 1.8k
211 lines (205 loc) Β· 8.21 KB
/
Copy pathdispatch_release.yml
File metadata and controls
211 lines (205 loc) Β· 8.21 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Dispatch release
# Kicks off a release by materializing news fragments into the selected
# packages' CHANGELOG.md files at the next version β the changelogs are the
# source of truth for publishing (see release_from_changelog.yml, which
# builds any changelog version that has no git tag yet and uploads it once
# the pypi environment deployment is approved).
#
# Leaving every package unchecked auto-selects the packages to release:
# those with pending news fragments β or, for release-from-prerelease, those
# whose changelog is topped by an alpha (the train's fragments are already
# consumed). Fragments in the repo-root news/ select reflex-base, which
# releases reflex alongside it.
#
# Prerelease actions (new-prerelease-*, continued-prerelease) write alpha
# versions and push them straight to an r/pre-<date> branch (continued
# prereleases push back to the r/pre-* branch the workflow was dispatched
# on); alphas build immediately and upload after pypi environment approval β
# no PR review involved. To pull new work into a prerelease train, merge
# main into the r/pre-* branch, then dispatch continued-prerelease on it.
#
# Release actions (release-*) open a pull request with the changelog changes
# instead β reviewing and merging that PR is how final versions land for
# publishing. The PR targets main, or the r/hotfix/** branch the workflow
# was dispatched on (hotfix branches may publish final versions directly).
# release-from-prerelease collapses the accumulated alpha sections into the
# single final-version section, so alpha headings never appear in a
# published final changelog.
#
# Materializing changelogs never publishes by itself: every PyPI upload β
# alphas included β additionally requires approval by the `pypi`
# environment's required reviewers (see publish.yml).
#
# REQUIRED CONFIGURATION:
# - The `pypi` environment must have required reviewers (asserted, fail
# closed, by publish.yml).
# - "Allow GitHub Actions to create and approve pull requests" must be
# enabled in the repo's Actions settings for release-* actions to open PRs.
# - Branch protection on main should require review; merging a release PR is
# what lands final versions for publishing.
# - Recommended: a ruleset restricting who can create/push r/** and
# release/** branches to maintainers plus the github-actions[bot] app
# (this workflow pushes as github-actions[bot] via GITHUB_TOKEN).
# - If the pypi environment restricts deployment branches, allow main,
# r/pre-*, and r/hotfix/*.
# - The old dispatch-release-approval environment is no longer used; the
# pypi environment reviewers and release-PR review replace it.
on:
workflow_dispatch:
inputs:
action:
description: "Release action"
required: true
type: choice
# default is continued-prerelease to prevent accidental releases.
default: continued-prerelease
options:
- new-prerelease-patch
- new-prerelease-minor
- new-prerelease-major
- continued-prerelease
- release-from-prerelease
- release-post
- release-patch
- release-minor
- release-major
hatch_reflex_pyi:
description: "hatch-reflex-pyi"
type: boolean
default: false
reflex_base:
description: "reflex-base"
type: boolean
default: false
reflex_components_code:
description: "reflex-components-code"
type: boolean
default: false
reflex_components_core:
description: "reflex-components-core"
type: boolean
default: false
reflex_components_dataeditor:
description: "reflex-components-dataeditor"
type: boolean
default: false
reflex_components_gridjs:
description: "reflex-components-gridjs"
type: boolean
default: false
reflex_components_lucide:
description: "reflex-components-lucide"
type: boolean
default: false
reflex_components_markdown:
description: "reflex-components-markdown"
type: boolean
default: false
reflex_components_moment:
description: "reflex-components-moment"
type: boolean
default: false
reflex_components_plotly:
description: "reflex-components-plotly"
type: boolean
default: false
reflex_components_radix:
description: "reflex-components-radix"
type: boolean
default: false
reflex_components_react_player:
description: "reflex-components-react-player"
type: boolean
default: false
reflex_components_recharts:
description: "reflex-components-recharts"
type: boolean
default: false
reflex_components_sonner:
description: "reflex-components-sonner"
type: boolean
default: false
reflex_docgen:
description: "reflex-docgen"
type: boolean
default: false
reflex_hosting_cli:
description: "reflex-hosting-cli"
type: boolean
default: false
permissions:
contents: read
concurrency:
group: dispatch-release-${{ github.ref }}
cancel-in-progress: false
jobs:
detect:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
packages: ${{ steps.detect.outputs.packages }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: detect
env:
hatch_reflex_pyi: ${{ inputs.hatch_reflex_pyi }}
reflex_base: ${{ inputs.reflex_base }}
reflex_components_code: ${{ inputs.reflex_components_code }}
reflex_components_core: ${{ inputs.reflex_components_core }}
reflex_components_dataeditor: ${{ inputs.reflex_components_dataeditor }}
reflex_components_gridjs: ${{ inputs.reflex_components_gridjs }}
reflex_components_lucide: ${{ inputs.reflex_components_lucide }}
reflex_components_markdown: ${{ inputs.reflex_components_markdown }}
reflex_components_moment: ${{ inputs.reflex_components_moment }}
reflex_components_plotly: ${{ inputs.reflex_components_plotly }}
reflex_components_radix: ${{ inputs.reflex_components_radix }}
reflex_components_react_player: ${{ inputs.reflex_components_react_player }}
reflex_components_recharts: ${{ inputs.reflex_components_recharts }}
reflex_components_sonner: ${{ inputs.reflex_components_sonner }}
reflex_docgen: ${{ inputs.reflex_docgen }}
reflex_hosting_cli: ${{ inputs.reflex_hosting_cli }}
run: bash .github/scripts/dispatch_release/detect.sh
materialize:
needs: detect
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-tags: true
fetch-depth: 0
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Plan versions
id: plan
env:
PACKAGES_JSON: ${{ needs.detect.outputs.packages }}
ACTION: ${{ inputs.action }}
run: uv run --no-config --locked --script scripts/release.py plan
- name: Materialize changelogs
env:
RELEASES_JSON: ${{ steps.plan.outputs.releases }}
ACTION: ${{ inputs.action }}
run: uv run --no-config --locked --script scripts/release.py materialize
- name: Push prerelease branch
if: ${{ !startsWith(inputs.action, 'release-') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTION: ${{ inputs.action }}
REF_NAME: ${{ github.ref_name }}
RELEASES: ${{ steps.plan.outputs.releases }}
run: bash .github/scripts/dispatch_release/push_prerelease.sh
- name: Open release pull request
if: ${{ startsWith(inputs.action, 'release-') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTION: ${{ inputs.action }}
REF_NAME: ${{ github.ref_name }}
RELEASES: ${{ steps.plan.outputs.releases }}
run: bash .github/scripts/dispatch_release/open_release_pr.sh