Skip to content

Commit eccf489

Browse files
committed
release: add script to build Linux release artifacts
This makes things more automated. While we're at it, we enable the timestamp in the tarballs to be consistent.
1 parent 99cecb1 commit eccf489

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

cpython-unix/build-main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ def main():
8888
env["PYBUILD_PYTHON_VERSION"] = entry["version"]
8989
env["PYBUILD_PYTHON_MAJOR_VERSION"] = ".".join(entry["version"].split(".")[0:2])
9090

91-
now = datetime.datetime.utcnow()
91+
if "PYBUILD_RELEASE_TAG" in os.environ:
92+
release_tag = os.environ["PYBUILD_RELEASE_TAG"]
93+
else:
94+
now = datetime.datetime.utcnow()
95+
release_tag = now.strftime("%Y%m%dT%H%M")
9296

9397
archive_components = [
9498
"cpython-%s" % entry["version"],
@@ -97,7 +101,7 @@ def main():
97101
]
98102

99103
build_basename = "-".join(archive_components) + ".tar"
100-
dist_basename = "-".join(archive_components + [now.strftime("%Y%m%dT%H%M")])
104+
dist_basename = "-".join(archive_components + [release_tag])
101105

102106
subprocess.run(["make"], env=env, check=True)
103107

release-linux.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this
4+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
6+
set -eo pipefail
7+
8+
export PYBUILD_RELEASE_TAG=$(date --utc '+%Y%m%dT%H%M')
9+
10+
./build-linux.py --target-triple x86_64-unknown-linux-gnu --python cpython-3.7 --optimizations debug --libressl
11+
./build-linux.py --target-triple x86_64-unknown-linux-gnu --python cpython-3.7 --optimizations pgo --libressl
12+
./build-linux.py --target-triple x86_64-unknown-linux-gnu --python cpython-3.8 --optimizations debug --libressl
13+
./build-linux.py --target-triple x86_64-unknown-linux-gnu --python cpython-3.8 --optimizations pgo --libressl
14+
15+
./build-linux.py --target-triple x86_64-unknown-linux-musl --python cpython-3.7 --optimizations debug --libressl
16+
./build-linux.py --target-triple x86_64-unknown-linux-musl --python cpython-3.7 --optimizations noopt --libressl
17+
./build-linux.py --target-triple x86_64-unknown-linux-musl --python cpython-3.8 --optimizations debug --libressl
18+
./build-linux.py --target-triple x86_64-unknown-linux-musl --python cpython-3.8 --optimizations noopt --libressl

0 commit comments

Comments
 (0)