-
Notifications
You must be signed in to change notification settings - Fork 13
Implement release process for rustup #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jdno
wants to merge
45
commits into
rust-lang:master
Choose a base branch
from
jdno:promote-rustup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
00e1a90
Fix error message when parsing actions
jdno 0a64d25
Create action for rustup
jdno 8d4a447
Implement release process for rustup
jdno d40ff45
Extract channel check for Rustup into function
jdno b803170
Get latest commit from Rustup's stable branch
jdno da3164d
Fetch next Rustup version from GitHub
jdno 49980a3
Download Rustup artifacts for a given commit
jdno c4cff77
Pass Rustup version to archive and manifest
jdno 7ccff04
Update documentation for Rustup release process
jdno ede844c
Refactor run script to execute different local releases
jdno 1e516af
Support other platforms than Linux
jdno b1dd2a2
Download Rustup files from CDN
jdno b843e51
Build promote-release inside the container if necessary
jdno f5c3c5e
Get download path from config
jdno a947033
Fix upload directory
jdno 883b5ed
Get version from user-provided commit
jdno ad86e13
Don't require GitHub credentials to fetch Rustup metadata
jdno 694e3a4
Create rustup-builds bucket in local environment
jdno 8132d69
Fix upload destination for Rustup archives
jdno 89f7324
Fix upload destination for stable Rustup release
jdno f82d531
Fix upload destination for Rustup manifest
jdno 9b7dba8
Configure environment to run Rustup releases locally
jdno 5aad90d
Set up CI workflows for refactored actions
jdno a52f975
Fix required jobs for deployments
jdno 839b35d
Merge branch 'master' into promote-rustup
jdno ad0c357
Fix unnecessary borrow warnings
jdno fd3f06d
Cut beta releases for Rustup from the stable branch
jdno a3a0d89
Allow Rustup version to be overridden in tests
jdno 57d5a20
Explicitly forward version in local tests
jdno b20a0c9
Fix unbound variable warning
jdno 776973f
Upgrade local container to Ubuntu 24.04
jdno c22a17e
Support workspace version for Rustup
jdno 9f4f3ab
Fix overriding the Rustup version
jdno e01d9e9
Fix paths when downloading Rustup artifacts
jdno 2befc10
Do not remove the default toolchain
jdno fbb3508
Bump MinIO version
jdno bbff20e
Always promote a new version
jdno f420838
Fix path for rustup artifact upload
jdno ace9066
Download the rustup installer as well
jdno af7e298
Fix archiving of rustup artifacts
jdno c9b96fe
Remove override for rustup version
jdno a5213b0
Restore override version and check for an update
jdno 9a096ec
Invalidate CDNs when publishing new rustup release
jdno acb0303
Fix auto-formatting in GitHub Action
jdno 1edda59
Skip CloudFront validations in loca rustup tests
jdno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/bin/bash | ||
|
||
# This script is executed at the start of each local release for Rustup, and | ||
# prepares the environment by copying the artifacts built by CI onto the MinIO | ||
# instance. Then, it starts promote-release with the right flags. | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
RUSTUP_REPO="https://github.com/rust-lang/rustup" | ||
RUSTUP_DEFAULT_BRANCH="stable" | ||
|
||
# S3 bucket from which to download the Rustup artifacts | ||
S3_BUCKET="rustup-builds" | ||
|
||
# CDN from which to download the CI artifacts | ||
DOWNLOAD_BASE="https://rustup-builds.rust-lang.org" | ||
|
||
# The artifacts for the following targets will be downloaded and copied during | ||
# the release process. At least one target is required. | ||
DOWNLOAD_TARGETS=( | ||
"aarch64-unknown-linux-gnu" | ||
"x86_64-unknown-linux-gnu" | ||
) | ||
|
||
# The following files will be downloaded and put into the local MinIO instance. | ||
DOWNLOAD_FILES=( | ||
"rustup-init" | ||
"rustup-init.sha256" | ||
"rustup-setup" | ||
"rustup-setup.sha256" | ||
) | ||
|
||
channel="$1" | ||
override_commit="$2" | ||
|
||
if [[ "${override_commit}" = "" ]]; then | ||
echo "==> detecting the last Rustup commit on the default branch" | ||
commit="$(git ls-remote "${RUSTUP_REPO}" | grep "refs/heads/${RUSTUP_DEFAULT_BRANCH}" | awk '{print($1)}')" | ||
else | ||
echo "=>> using overridden commit ${override_commit}" | ||
commit="${override_commit}" | ||
fi | ||
|
||
for target in "${DOWNLOAD_TARGETS[@]}"; do | ||
if ! mc stat "local/rustup-builds/${commit}/dist/${target}" >/dev/null 2>&1; then | ||
echo "==> copying ${target} from S3" | ||
|
||
for file in "${DOWNLOAD_FILES[@]}"; do | ||
echo "==> copying ${file} from S3" | ||
|
||
if curl -Lo /tmp/component "${DOWNLOAD_BASE}/${commit}/dist/${target}/${file}" --fail; then | ||
mc cp /tmp/component "local/rustup-builds/${commit}/dist/${target}/${file}" >/dev/null | ||
fi | ||
done | ||
else | ||
echo "==> reusing cached ${target} target" | ||
fi | ||
done | ||
|
||
if ! mc stat "local/rustup-builds/${commit}/rustup-init.sh" >/dev/null 2>&1; then | ||
echo "==> copying rustup-init.sh from S3" | ||
|
||
if curl -Lo /tmp/component "${DOWNLOAD_BASE}/${commit}/rustup-init.sh" --fail; then | ||
mc cp /tmp/component "local/rustup-builds/${commit}/rustup-init.sh" >/dev/null | ||
fi | ||
else | ||
echo "==> reusing cached rustup-init.sh" | ||
fi | ||
|
||
# Build the promote-release binary if it hasn't been pre-built | ||
if [[ ! -f "/src/target/release/promote-release" ]]; then | ||
echo "==> building promote-release" | ||
cd /src | ||
cargo build --release | ||
cd .. | ||
fi | ||
|
||
echo "==> configuring the environment" | ||
|
||
# Release Rustup | ||
export PROMOTE_RELEASE_ACTION="promote-rustup" | ||
|
||
# Point to the right GnuPG environment | ||
export GNUPGHOME=/persistent/gpg-home | ||
|
||
## Environment variables also used in prod releases | ||
export AWS_ACCESS_KEY_ID="access_key" | ||
export AWS_SECRET_ACCESS_KEY="secret_key" | ||
export PROMOTE_RELEASE_CHANNEL="${channel}" | ||
export PROMOTE_RELEASE_CLOUDFRONT_DOC_ID="" | ||
export PROMOTE_RELEASE_CLOUDFRONT_STATIC_ID="" | ||
export PROMOTE_RELEASE_DOWNLOAD_BUCKET="rustup-builds" | ||
export PROMOTE_RELEASE_DOWNLOAD_DIR="" | ||
export PROMOTE_RELEASE_GPG_KEY_FILE="" | ||
export PROMOTE_RELEASE_GPG_PASSWORD_FILE="" | ||
export PROMOTE_RELEASE_SKIP_CLOUDFRONT_INVALIDATIONS="yes" | ||
export PROMOTE_RELEASE_UPLOAD_ADDR="" | ||
export PROMOTE_RELEASE_UPLOAD_BUCKET="static" | ||
export PROMOTE_RELEASE_UPLOAD_STORAGE_CLASS="STANDARD" | ||
export PROMOTE_RELEASE_UPLOAD_DIR="rustup" | ||
|
||
## Environment variables used only by local releases | ||
export PROMOTE_RELEASE_S3_ENDPOINT_URL="http://minio:9000" | ||
|
||
# Conditional environment variables | ||
if [[ "${override_commit}" != "" ]]; then | ||
export PROMOTE_RELEASE_OVERRIDE_COMMIT="${override_commit}" | ||
fi | ||
|
||
# Conditionally set a version for the next Rustup release | ||
if [[ "${RUSTUP_OVERRIDE_VERSION:-}" != "" ]]; then | ||
export PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION="${RUSTUP_OVERRIDE_VERSION}" | ||
fi | ||
|
||
echo "==> starting promote-release" | ||
/src/target/release/promote-release /persistent/release "${channel}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdated comment now that we are not removing the default toolchain?