Skip to content

Commit f964d9d

Browse files
authored
Add promotion script for pytorch releases (pytorch#521)
1 parent 7fdf097 commit f964d9d

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

release/promote.sh

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/usr/bin/env bash
2+
3+
set -eou pipefail
4+
5+
# Make sure to update these versions when doing a release first
6+
PYTORCH_VERSION=${PYTORCH_VERSION:-1.6.0}
7+
TORCHVISION_VERSION=${TORCHVISION_VERSION:-0.7.0}
8+
TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION:-0.6.0}
9+
TORCHTEXT_VERSION=${TORCHTEXT_VERSION:-0.7.0}
10+
TORCHSERVE_VERSION=${TORCHSERVE_VERSION:-0.2.1}
11+
TORCHCSPRNG_VERSION=${TORCHCSPRNG_VERSION:-0.1.2}
12+
13+
PYTORCH_DIR=${PYTORCH_DIR:-~/pytorch}
14+
15+
DRY_RUN=${DRY_RUN:-enabled}
16+
17+
promote_s3() {
18+
local package_name
19+
package_name=$1
20+
local package_type
21+
package_type=$2
22+
local promote_version
23+
promote_version=$3
24+
25+
echo "=-=-=-= Promoting ${package_name}'s v${promote_version} ${package_type} packages' =-=-=-="
26+
(
27+
set -x
28+
TEST_PYTORCH_PROMOTE_VERSION="${promote_version}" \
29+
PACKAGE_NAME="${package_name}" \
30+
PACKAGE_TYPE="${package_type}" \
31+
TEST_WITHOUT_GIT_TAG=1 \
32+
DRY_RUN="${DRY_RUN}" ${PYTORCH_DIR}/scripts/release/promote/s3_to_s3.sh
33+
)
34+
echo
35+
}
36+
37+
promote_conda() {
38+
local package_name
39+
package_name=$1
40+
local package_type
41+
package_type=$2
42+
local promote_version
43+
promote_version=$3
44+
echo "=-=-=-= Promoting ${package_name}'s v${promote_version} ${package_type} packages' =-=-=-="
45+
(
46+
set -x
47+
TEST_PYTORCH_PROMOTE_VERSION="${promote_version}" \
48+
PACKAGE_NAME="${package_name}" \
49+
PACKAGE_TYPE="${package_type}" \
50+
TEST_WITHOUT_GIT_TAG=1 \
51+
DRY_RUN="${DRY_RUN}" ${PYTORCH_DIR}/scripts/release/promote/conda_to_conda.sh
52+
)
53+
echo
54+
}
55+
56+
promote_pypi() {
57+
local package_name
58+
package_name=$1
59+
local promote_version
60+
promote_version=$2
61+
echo "=-=-=-= Promoting ${package_name}'s v${promote_version} to pypi' =-=-=-="
62+
(
63+
set -x
64+
TEST_PYTORCH_PROMOTE_VERSION="${promote_version}" \
65+
PACKAGE_NAME="${package_name}" \
66+
TEST_WITHOUT_GIT_TAG=1 \
67+
DRY_RUN="${DRY_RUN}" ${PYTORCH_DIR}/scripts/release/promote/wheel_to_pypi.sh
68+
)
69+
echo
70+
}
71+
72+
promote_s3 torch whl "${PYTORCH_VERSION}"
73+
promote_s3 torchvision whl "${TORCHVISION_VERSION}"
74+
promote_s3 torchaudio whl "${TORCHAUDIO_VERSION}"
75+
promote_s3 torchtext whl "${TORCHTEXT_VERSION}"
76+
promote_s3 torchserve whl "${TORCHSERVE_VERSION}"
77+
promote_s3 torch_model_archiver whl "${TORCHSERVE_VERSION}"
78+
promote_s3 torchcsprng whl "${TORCHCSPRNG_VERSION}"
79+
80+
promote_s3 "libtorch-*" libtorch "${PYTORCH_VERSION}"
81+
82+
promote_conda pytorch conda "${PYTORCH_VERSION}"
83+
promote_conda torchvision conda "${TORCHVISION_VERSION}"
84+
promote_conda torchaudio conda "${TORCHAUDIO_VERSION}"
85+
promote_conda torchtext conda "${TORCHTEXT_VERSION}"
86+
promote_conda torchserve conda "${TORCHSERVE_VERSION}"
87+
promote_conda torch-model-archiver conda "${TORCHSERVE_VERSION}"
88+
promote_conda torchcsprng conda "${TORCHCSPRNG_VERSION}"
89+
90+
# Uncomment these to promote to pypi
91+
# promote_pypi torch "${PYTORCH_VERSION}"
92+
# promote_pypi torchvision "${TORCHVISION_VERSION}"
93+
# promote_pypi torchaudio "${TORCHAUDIO_VERSION}"
94+
# promote_pypi torchtext "${TORCHTEXT_VERSION}"
95+
# promote_pypi torchcsprng "${TORCHCSPRNG_VERSION}"

0 commit comments

Comments
 (0)