Skip to content

Commit a8747fa

Browse files
committed
Add parameter to check-releases to force rebuild every releases
1 parent bcdd879 commit a8747fa

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.github/scripts/check-releases.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def main() -> int:
209209
print("MAX_PARALLELISM must be >= 1", file=sys.stderr)
210210
return 1
211211
dry_run = parse_bool(os.environ.get("DRY_RUN"))
212+
force_rebuild = parse_bool(os.environ.get("FORCE_REBUILD", "false"))
212213

213214
# Fetch all v* tags from python/cpython
214215
refs = gh_get_paginated("/repos/python/cpython/git/matching-refs/tags/v", token)
@@ -237,8 +238,12 @@ def main() -> int:
237238

238239
version_re = re.compile(rf"^{re.escape(normalised)}-[0-9]+$")
239240
if any(version_re.match(t) for t in existing_tags):
240-
log(" already released, skipping")
241-
continue
241+
if force_rebuild:
242+
log(" already released, force rebuilding anyway")
243+
# fall through
244+
else:
245+
log(" already released, skipping")
246+
continue
242247

243248
if tag in DENYLIST:
244249
log(" in denylist, skipping")

.github/workflows/check-releases.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ on:
55
- cron: '0 6 * * *'
66
workflow_dispatch:
77
inputs:
8-
max_parallelism:
8+
max-parallelism:
99
description: "Maximum number of build-python.yml runs in flight at once"
1010
required: false
1111
default: "10"
1212
type: string
13-
dry_run:
13+
dry-run:
1414
description: "List candidates without dispatching any builds"
1515
required: false
1616
default: false
1717
type: boolean
18+
force-rebuild:
19+
description: "Force the build of the specified versions, overwriting them if they already exist"
20+
required: false
21+
default: false
22+
type: boolean
1823

1924
permissions:
2025
contents: read
@@ -32,6 +37,7 @@ jobs:
3237
GITHUB_REPOSITORY: ${{ github.repository }}
3338
MAX_PARALLELISM: ${{ inputs.max_parallelism || '10' }}
3439
DRY_RUN: ${{ inputs.dry_run && 'true' || 'false' }}
40+
FORCE_REBUILD: ${{ inputs.force-rebuild && 'true' || 'false' }}
3541
steps:
3642
- name: Checkout repo
3743
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

0 commit comments

Comments
 (0)