Skip to content

infra: Automate SHA procedure during releases #3424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ jobs:
gh pr create --title "[$GITHUB_REF_NAME] $title" \
--body "Clean cherry-pick of #$NUMBER to the \`$GITHUB_REF_NAME\` branch." \
--head $branch \
--base $GITHUB_REF_NAME
--base $GITHUB_REF_NAME \
--label backport
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}{% endraw %}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}{% endraw %}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}{% endraw %}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/lint_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/package-prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ jobs:
gh pr create --title "[$GITHUB_REF_NAME] $message" \
--body "$message." \
--head $branch \
--base $GITHUB_REF_NAME
--base $GITHUB_REF_NAME \
--label prepare-release
6 changes: 4 additions & 2 deletions .github/workflows/package-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ jobs:
gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
--body "$message." \
--head $branch \
--base $RELEASE_BRANCH_NAME
--base $RELEASE_BRANCH_NAME \
--label prepare-release

create-pull-request-against-main:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -195,4 +196,5 @@ jobs:
gh pr create --title "$message" \
--body "$body" \
--head $branch \
--base main
--base main \
--label prepare-release
3 changes: 2 additions & 1 deletion .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ jobs:
gh pr create --title "[$GITHUB_REF_NAME] $message" \
--body "$message." \
--head $branch \
--base $GITHUB_REF_NAME
--base $GITHUB_REF_NAME \
--label prepare-release
6 changes: 4 additions & 2 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ jobs:
gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
--body "$message." \
--head $branch \
--base $RELEASE_BRANCH_NAME
--base $RELEASE_BRANCH_NAME \
--label prepare-release

create-pull-request-against-main:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -192,4 +193,5 @@ jobs:
gh pr create --title "$message" \
--body "$body" \
--head $branch \
--base main
--base main \
--label prepare-release
10 changes: 9 additions & 1 deletion .github/workflows/test_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: true

env:
CORE_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
CONTRIB_REPO_SHA: main
PIP_EXISTS_ACTION: w

Expand Down