File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # Usage (run from root of project):
4+ # TEST_INFRA_BRANCH=release/2.1 RELEASE_BRANCH=release/2.1 RELEASE_VERSION=2.1.0 packaging/cut_release.sh
5+ #
6+ # TEST_INFRA_BRANCH: The release branch of test-infra that houses all reusable
7+ # workflows
8+ #
9+ # RELEASE_BRANCH: The name of the release branch for this repo
10+ #
11+ # RELEASE_VERSION: Version of this current release
12+
13+ set -eou pipefail
14+
15+ # Create and Check out to Release Branch
16+ git checkout -b " ${RELEASE_BRANCH} "
17+
18+ # Change all GitHub Actions to reference the test-infra release branch
19+ # as opposed to main.
20+ for i in .github/workflows/* .yml; do
21+ if [[ " $OSTYPE " == " darwin" * ]]; then
22+ sed -i ' ' -e s#@main#@" ${TEST_INFRA_BRANCH} " # $i;
23+ sed -i ' ' -e s#test-infra-ref:[[:space:]]main#" test-infra-ref: ${TEST_INFRA_BRANCH} " # $i;
24+ else
25+ sed -i -e s#@main#@" ${TEST_INFRA_BRANCH} " # $i;
26+ sed -i -e s#test-infra-ref:[[:space:]]main#" test-infra-ref: ${TEST_INFRA_BRANCH} " # $i;
27+ fi
28+ done
29+
30+ # Update the Release Version in version.txt
31+ echo " ${RELEASE_VERSION} " > version.txt
32+
33+ # Optional
34+ # git add ./github/workflows/*.yml version.txt
35+ # git commit -m "[RELEASE-ONLY CHANGES] Branch Cut for Release {RELEASE_VERSION}"
36+ # git push origin "${RELEASE_BRANCH}"
You can’t perform that action at this time.
0 commit comments