Skip to content

Commit dff63be

Browse files
atalmanSkylion007
authored andcommitted
Apply release only changes to core (pytorch#109208)
Utility script to run after branch cut have been completed. Execute: ``RELEASE_VERSION=2.1 apply-release-changes.sh`` Similar to: pytorch/audio#3590 Test PR: pytorch#109210 Automate generation of PRs: pytorch#108053 pytorch#108688 pytorch#108064 Pull Request resolved: pytorch#109208 Approved by: https://github.com/seemethere
1 parent b5e2435 commit dff63be

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Usage (run from root of project):
4+
# RELEASE_VERSION=2.1 apply-release-changes.sh
5+
#
6+
# RELEASE_VERSION: Version of this current release
7+
8+
set -eou pipefail
9+
10+
# Create and Check out to Release Branch
11+
# git checkout -b "${RELEASE_BRANCH}"
12+
13+
# Change all GitHub Actions to reference the test-infra release branch
14+
# as opposed to main.
15+
echo "Applying to workflows"
16+
for i in .github/workflows/*.yml; do
17+
sed -i -e s#@main#@"release/${RELEASE_VERSION}"# $i;
18+
done
19+
20+
# Change all checkout step in templates to not add ref to checkout
21+
echo "Applying to templates"
22+
for i in .github/templates/*.yml.j2; do
23+
sed -i 's#common.checkout(\(.*\))#common.checkout(\1, checkout_pr_head=False)#' $i;
24+
done
25+
# Change conda token for test env for conda upload
26+
sed -i 's#CONDA_PYTORCHBOT_TOKEN#CONDA_PYTORCHBOT_TOKEN_TEST#' .github/templates/upload.yml.j2
27+
28+
# Triton wheel
29+
echo "Triton Changes"
30+
sed -i -e s#-\ main#"-\ release\/${RELEASE_VERSION}"# .github/workflows/build-triton-wheel.yml
31+
32+
# XLA related changes
33+
echo "XLA Changes"
34+
sed -i -e s#--quiet#-b\ r"${RELEASE_VERSION}"# .ci/pytorch/common_utils.sh
35+
sed -i -e s#.*#r"${RELEASE_VERSION}"# .github/ci_commit_pins/xla.txt
36+
37+
# Binary tests
38+
echo "Binary tests"
39+
sed -i 's#/nightly/#/test/#' .circleci/scripts/binary_linux_test.sh
40+
sed -i 's#"\\${PYTORCH_CHANNEL}"#pytorch-test#' .circleci/scripts/binary_linux_test.sh
41+
42+
# Regenerated templates
43+
./.github/regenerate.sh
44+
45+
# Optional
46+
# git commit -m "[RELEASE-ONLY CHANGES] Branch Cut for Release {RELEASE_VERSION}"
47+
# git push origin "${RELEASE_BRANCH}"

0 commit comments

Comments
 (0)