File tree Expand file tree Collapse file tree 4 files changed +17
-30
lines changed Expand file tree Collapse file tree 4 files changed +17
-30
lines changed Original file line number Diff line number Diff line change 6565 name : Local rustup
6666 runs-on : ubuntu-latest
6767
68- env :
69- RUSTUP_OVERRIDE_VERSION : 99.0.0
70-
7168 strategy :
7269 fail-fast : false
7370 matrix :
8077 - name : Ensure Rust Stable is up to date
8178 run : rustup self update && rustup update stable
8279
80+ - name : Get the current rustup version
81+ run : echo "PREVIOUS_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
82+
8383 - name : Start the local environment
8484 run : docker compose up -d
8585
9191 env :
9292 RUSTUP_UPDATE_ROOT : http://localhost:9000/static/rustup
9393
94+ - name : Get the new rustup version
95+ run : echo "NEW_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
96+
9497 - name : Verify Rustup version
95- run : rustup --version | grep -q ${{ env.RUSTUP_OVERRIDE_VERSION }}
98+ run : |
99+ if [[ "${PREVIOUS_RUSTUP_VERSION}" == "${NEW_RUSTUP_VERSION}" ]]; then
100+ echo "Rustup version did not change"
101+ exit 1
102+ else
103+ echo "Previous Rustup version: ${PREVIOUS_RUSTUP_VERSION}"
104+ echo "New Rustup version: ${NEW_RUSTUP_VERSION}"
105+ fi
96106
97107 docker :
98108 name : Build Docker image
Original file line number Diff line number Diff line change @@ -107,10 +107,5 @@ if [[ "${override_commit}" != "" ]]; then
107107 export PROMOTE_RELEASE_OVERRIDE_COMMIT=" ${override_commit} "
108108fi
109109
110- # Conditionally set a version for the next Rustup release
111- if [[ " ${RUSTUP_OVERRIDE_VERSION:- } " != " " ]]; then
112- export PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION=" ${RUSTUP_OVERRIDE_VERSION} "
113- fi
114-
115110echo " ==> starting promote-release"
116111/src/target/release/promote-release /persistent/release " ${channel} "
Original file line number Diff line number Diff line change 55set -euo pipefail
66IFS=$' \n\t '
77
8- RUSTUP_OVERRIDE_VERSION=" ${RUSTUP_OVERRIDE_VERSION:- } "
9-
108if [[ " $# " -lt 1 ]]; then
119 echo " Usage: $0 <release|rustup>"
1210 exit 1
@@ -50,11 +48,5 @@ if [[ "$(uname)" == "Linux" ]]; then
5048 cargo build --release
5149fi
5250
53- if [[ " $RUSTUP_OVERRIDE_VERSION " != " " ]]; then
54- # If the RUSTUP_OVERRIDE_VERSION environment variable is set, forward it to the Docker environment.
55- echo " ==> running local release with override version ${RUSTUP_OVERRIDE_VERSION} "
56- docker compose exec -e " RUSTUP_OVERRIDE_VERSION=${RUSTUP_OVERRIDE_VERSION} " -T local " /src/local/${command} .sh" " ${channel} " " ${override_commit} "
57- else
58- # Run the command inside the docker environment.
59- docker compose exec -T local " /src/local/${command} .sh" " ${channel} " " ${override_commit} "
60- fi
51+ # Run the command inside the docker environment.
52+ docker compose exec -T local " /src/local/${command} .sh" " ${channel} " " ${override_commit} "
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ impl Context {
6161 let head_sha = self . get_commit_sha_for_rustup_release ( ) ?;
6262
6363 // The commit on the `stable` branch is used to determine the version number
64- let version = self . get_next_rustup_version ( & head_sha) ?;
64+ let version = self . get_next_rustup_version_from_github ( & head_sha) ?;
6565
6666 // Download the Rustup artifacts from S3
6767 let dist_dir = self . download_rustup_artifacts ( & head_sha) ?;
@@ -115,16 +115,6 @@ impl Context {
115115 Ok ( commit. sha )
116116 }
117117
118- fn get_next_rustup_version ( & self , sha : & str ) -> anyhow:: Result < String > {
119- // Allow the version to be overridden manually, for example to test the release process
120- if let Ok ( version) = std:: env:: var ( "PROMOTE_RELEASE_RUSTUP_OVERRIDE_VERSION" ) {
121- println ! ( "Using override version: {}" , version) ;
122- Ok ( version)
123- } else {
124- self . get_next_rustup_version_from_github ( sha)
125- }
126- }
127-
128118 fn get_next_rustup_version_from_github ( & self , sha : & str ) -> anyhow:: Result < String > {
129119 println ! ( "Getting next Rustup version from Cargo.toml..." ) ;
130120
You can’t perform that action at this time.
0 commit comments