Skip to content

Commit 81471c8

Browse files
authored
Merge branch 'main' into pil-fill
2 parents 33e31ed + 439c5e3 commit 81471c8

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

packaging/cut_release.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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}"

0 commit comments

Comments
 (0)