Commit 3b93ae6
authored
🚀 [Feature]: Add PrereleaseLabels support and ReleaseType calculation (#6)
The workflow now supports configurable prerelease labels and introduces
`ReleaseType` as a single source of truth for determining what action
the publish workflow should take. Previously, the `prerelease` label
check was hardcoded while all other labels were configurable, and adding
a prerelease label to a PR did not trigger the publish workflow.
## PrereleaseLabels Configuration
You can now customize which labels trigger a prerelease build via the
`PSModule.yml` settings file:
```yaml
Publish:
Module:
PrereleaseLabels: prerelease, beta, alpha
```
The default value is `prerelease`, maintaining backward compatibility.
## ReleaseType - Single Source of Truth
A new `ReleaseType` property is now calculated and included in the `Run`
object with these values:
| Value | Trigger | Action |
|-------|---------|--------|
| `Release` | PR merged to default branch | Create stable release |
| `Prerelease` | PR has prerelease label OR prerelease label just added
| Create prerelease |
| `Cleanup` | PR closed without merge (abandoned) | Delete old
prereleases |
| `None` | Any other scenario | Skip publishing |
This simplifies the publish logic and makes debugging easier since
`ReleaseType` is visible in the Get-Settings logs.
## Changes
- Added `PrereleaseLabels` setting with default value `prerelease`
- Added detection for when a prerelease label is added via the `labeled`
action
- Introduced `ReleaseType` calculation as the single source of truth
- Updated `PublishModule` condition to use `$releaseType -ne 'None'`
- Added `ReleaseType` to the `Run` object for downstream consumption
- Updated JSON schema with `PrereleaseLabels` and `ReleaseType`
definitions1 parent ce4aac7 commit 3b93ae6
2 files changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
331 | 340 | | |
332 | 341 | | |
333 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
246 | 269 | | |
247 | 270 | | |
248 | 271 | | |
249 | 272 | | |
250 | 273 | | |
251 | 274 | | |
| 275 | + | |
| 276 | + | |
252 | 277 | | |
253 | 278 | | |
254 | 279 | | |
| |||
438 | 463 | | |
439 | 464 | | |
440 | 465 | | |
441 | | - | |
| 466 | + | |
| 467 | + | |
442 | 468 | | |
443 | 469 | | |
444 | 470 | | |
| |||
0 commit comments