Skip to content

Commit 4a3f267

Browse files
authored
ci(release): advance seeded prereleases daily at Zurich time (#3239)
* ci(release): advance seeded prereleases daily at Zurich time Signed-off-by: Simon Scatton <sscatton@nvidia.com> * ci(release): schedule prereleases on weekdays Signed-off-by: Simon Scatton <sscatton@nvidia.com> --------- Signed-off-by: Simon Scatton <sscatton@nvidia.com>
1 parent b3e4ad4 commit 4a3f267

2 files changed

Lines changed: 49 additions & 17 deletions

File tree

‎.github/workflows/release-auto-tag.yml‎

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ name: Release Auto-Tag
55

66
on:
77
workflow_dispatch: {}
8-
# schedule:
9-
# - cron: "0 14 * * 1-5" # 7 AM PDT, weekdays only
8+
schedule:
9+
- cron: "0 14 * * 1-5"
10+
timezone: "Europe/Zurich"
1011

1112
permissions:
1213
contents: write
@@ -19,17 +20,40 @@ concurrency:
1920
jobs:
2021
create-tag:
2122
runs-on: ubuntu-latest
23+
timeout-minutes: 5
2224
steps:
2325
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2426
with:
27+
ref: main
2528
fetch-depth: 0
2629

27-
- name: Determine next patch version
30+
- name: Determine next pre-release version
2831
id: version
2932
run: |
30-
latest=$(git tag -l 'v*.*.*' --sort=-v:refname | head -1)
31-
if [ -z "$latest" ]; then
32-
echo "::error::No existing v*.*.* tags found"
33+
set -euo pipefail
34+
tags=$(git tag -l)
35+
latest=$(printf '%s\n' "$tags" | \
36+
{ grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-pre\.[1-9][0-9]*)?$' || true; } | \
37+
sort -V | tail -1)
38+
if [[ ! "$latest" =~ ^(v[0-9]+\.[0-9]+\.[0-9]+)-pre\.([1-9][0-9]*)$ ]]; then
39+
echo "No active pre-release series — skipping tag creation"
40+
echo "skip=true" >> "$GITHUB_OUTPUT"
41+
exit 0
42+
fi
43+
base=${BASH_REMATCH[1]}
44+
number=${BASH_REMATCH[2]}
45+
if ! git show-ref --verify --quiet "refs/tags/${base}-pre.1"; then
46+
echo "No ${base}-pre.1 seed — skipping tag creation"
47+
echo "skip=true" >> "$GITHUB_OUTPUT"
48+
exit 0
49+
fi
50+
if git show-ref --verify --quiet "refs/tags/${base}"; then
51+
echo "$base is already stable — skipping tag creation"
52+
echo "skip=true" >> "$GITHUB_OUTPUT"
53+
exit 0
54+
fi
55+
if ! git merge-base --is-ancestor "$latest" HEAD; then
56+
echo "::error::Latest pre-release $latest is not an ancestor of main"
3357
exit 1
3458
fi
3559
echo "Latest tag: $latest"
@@ -43,10 +67,7 @@ jobs:
4367
exit 0
4468
fi
4569
46-
major=$(echo "$latest" | sed 's/^v//' | cut -d. -f1)
47-
minor=$(echo "$latest" | sed 's/^v//' | cut -d. -f2)
48-
patch=$(echo "$latest" | sed 's/^v//' | cut -d. -f3)
49-
next="v${major}.${minor}.$((patch + 1))"
70+
next="${base}-pre.$((number + 1))"
5071
5172
if git tag -l "$next" | grep -q .; then
5273
echo "::error::Tag $next already exists"
@@ -58,15 +79,18 @@ jobs:
5879
5980
- name: Create and push tag
6081
if: steps.version.outputs.skip != 'true'
82+
env:
83+
NEXT_TAG: ${{ steps.version.outputs.next }}
6184
run: |
62-
git tag ${{ steps.version.outputs.next }}
63-
git push origin ${{ steps.version.outputs.next }}
85+
git tag "$NEXT_TAG"
86+
git push origin "refs/tags/$NEXT_TAG"
6487
6588
- name: Trigger Release Tag workflow
6689
if: steps.version.outputs.skip != 'true'
6790
env:
6891
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
NEXT_TAG: ${{ steps.version.outputs.next }}
6993
run: |
7094
gh workflow run release-tag.yml \
7195
--ref main \
72-
-f tag=${{ steps.version.outputs.next }}
96+
-f tag="$NEXT_TAG"

‎architecture/build.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,18 @@ job republishes the analysis job's outcome as the
420420
required statuses, so they do not gate merges.
421421

422422
Codex Security findings are informational during the observation phase, and the
423-
workflow only reports on candidates that already exist. Creating pre-release
424-
tags and gating stable promotion on qualification results are part of
425-
[RFC 0014](../rfc/0014-release-stability/release-qualification.md) and are not
426-
implemented yet.
423+
workflow only reports on candidates that already exist. Gating stable promotion
424+
on qualification results remains proposed in
425+
[RFC 0014](../rfc/0014-release-stability/release-qualification.md).
426+
427+
`release-auto-tag.yml` runs at 14:00 Europe/Zurich on weekdays (including daylight
428+
saving time changes) and supports manual dispatch. Maintainers start weekday
429+
pre-release publishing by tagging the initial `vX.Y.Z-pre.1` release candidate.
430+
The workflow increments the highest release series' pre-release number on `main`
431+
only when that seed exists, its stable tag does not exist, and new commits are
432+
available. It never chooses a minor or patch version or creates the initial seed.
433+
After pushing the tag, it explicitly dispatches `release-tag.yml` to build the
434+
candidate.
427435

428436
See `CI.md` for the contributor workflow, labels, and maintainer merge-queue workflow.
429437

0 commit comments

Comments
 (0)