Skip to content

Commit 013d92c

Browse files
committed
builder: pass RUST_VERSION extracted from rust-toolchain.toml
1 parent f8bdcec commit 013d92c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.github/builder/common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -e
77

8-
if [ -z "${RUST_NIGHTLY_DATE}" ]; then
8+
if [ -z "${RUST_VERSION}" ]; then
99
echo "RUST_NIGHTLY_DATE not set. It should be defined by ci.yml workflow."
1010
exit 1
1111
fi
@@ -112,8 +112,8 @@ download_and_verify_make() {
112112

113113
download_and_verify_rust() {
114114
RUST_GPG_KEY_URL="https://static.rust-lang.org/rust-key.gpg.ascii"
115-
RUST_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz"
116-
RUST_SIG_URL="https://static.rust-lang.org/dist/${RUST_NIGHTLY_DATE}/rust-nightly-x86_64-unknown-linux-gnu.tar.xz.asc"
115+
RUST_URL="https://static.rust-lang.org/dist/rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
116+
RUST_SIG_URL="https://static.rust-lang.org/dist/rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz.asc"
117117

118118
if [ -z "${BUILDER_DIR}" ]; then
119119
echo "BUILDER_DIR not set. Exiting..."

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,17 +665,16 @@ jobs:
665665
with open('rust-toolchain.toml', 'rb') as f:
666666
data = tomllib.load(f)
667667
channel = data['toolchain']['channel']
668-
date = channel.split("nightly-")[1]
669668
670669
with open(os.environ['GITHUB_OUTPUT'], 'a') as out:
671-
out.write(f'nightly_date={date}\n')
670+
out.write(f'rust_version={channel}\n')
672671
673672
# NOTE: This script only downloads the builder dependencies if they do not already exist,
674673
# but it always verifies them.
675674
- name: Build Distribution Package
676675
run: |
677-
RUST_NIGHTLY_DATE="${{ steps.rust-channel.outputs.nightly_date }}"
678-
export RUST_NIGHTLY_DATE
676+
RUST_VERSION="${{ steps.rust-channel.outputs.rust_version }}"
677+
export RUST_VERSION
679678
./scripts/build.sh
680679
681680
- name: Upload Distribution Package

0 commit comments

Comments
 (0)