-
Notifications
You must be signed in to change notification settings - Fork 1.7k
196 lines (189 loc) ยท 6.66 KB
/
dispatch_release.yml
File metadata and controls
196 lines (189 loc) ยท 6.66 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
name: Dispatch release
# REQUIRED CONFIGURATION: any action starting with `release-` is gated on the
# `dispatch-release-approval` environment. The gate only enforces a second
# approval if that environment has required reviewers configured in repo
# Settings โ Environments. Without reviewers configured, the gate job
# auto-succeeds and provides NO protection โ verify the environment is set up
# before relying on this workflow for production releases.
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
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
plan:
needs: detect
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
releases: ${{ steps.plan.outputs.releases }}
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
- id: plan
env:
PACKAGES_JSON: ${{ needs.detect.outputs.packages }}
ACTION: ${{ inputs.action }}
run: uv run --script .github/scripts/dispatch_release/plan.py
gate:
needs: plan
if: ${{ startsWith(inputs.action, 'release-') }}
runs-on: ubuntu-latest
permissions:
contents: read
environment: dispatch-release-approval
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Show release plan
env:
RELEASES: ${{ needs.plan.outputs.releases }}
ACTION: ${{ inputs.action }}
run: bash .github/scripts/dispatch_release/show_plan.sh
release:
needs: [plan, gate]
if: ${{ always() && needs.plan.result == 'success' && (needs.gate.result == 'success' || needs.gate.result == 'skipped') }}
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
strategy:
matrix:
include: ${{ fromJson(needs.plan.outputs.releases) }}
fail-fast: false
concurrency:
group: dispatch-release-${{ matrix.package }}
cancel-in-progress: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ matrix.tag }}
PKG: ${{ matrix.package }}
VERSION: ${{ matrix.next }}
ACTION: ${{ inputs.action }}
run: bash .github/scripts/dispatch_release/create_release.sh
- name: Trigger publish workflow
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ matrix.tag }}
REF: ${{ github.ref_name }}
run: bash .github/scripts/dispatch_release/trigger_publish.sh