File tree 4 files changed +19
-30
lines changed
4 files changed +19
-30
lines changed Original file line number Diff line number Diff line change 65
65
name : Local rustup
66
66
runs-on : ubuntu-latest
67
67
68
- env :
69
- RUSTUP_OVERRIDE_VERSION : 99.0.0
70
-
71
68
strategy :
72
69
fail-fast : false
73
70
matrix :
80
77
- name : Ensure Rust Stable is up to date
81
78
run : rustup self update && rustup update stable
82
79
80
+ - name : Get the current rustup version
81
+ id : previous-rustup-version
82
+ run : echo "PREVIOUS_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
83
+
83
84
- name : Start the local environment
84
85
run : docker compose up -d
85
86
91
92
env :
92
93
RUSTUP_UPDATE_ROOT : http://localhost:9000/static/rustup
93
94
95
+ - name : Get the new rustup version
96
+ id : new-rustup-version
97
+ run : echo "NEW_RUSTUP_VERSION=$(rustup --version | cut -d ' ' -f 2)" >> $GITHUB_ENV
98
+
94
99
- name : Verify Rustup version
95
- run : rustup --version | grep -q ${{ env.RUSTUP_OVERRIDE_VERSION }}
100
+ run : |
101
+ if [ "${{ steps.previous-rustup-version.outputs.PREVIOUS_RUSTUP_VERSION }}" == "${{ steps.new-rustup-version.outputs.NEW_RUSTUP_VERSION }}" ]; then
102
+ echo "Rustup version did not change"
103
+ exit 1
104
+ else
105
+ echo "Previous Rustup version: ${{ steps.previous-rustup-version.outputs.PREVIOUS_RUSTUP_VERSION }}"
106
+ echo "New Rustup version: ${{ steps.new-rustup-version.outputs.NEW_RUSTUP_VERSION }}"
107
+ fi
96
108
97
109
docker :
98
110
name : Build Docker image
Original file line number Diff line number Diff line change @@ -107,10 +107,5 @@ if [[ "${override_commit}" != "" ]]; then
107
107
export PROMOTE_RELEASE_OVERRIDE_COMMIT=" ${override_commit} "
108
108
fi
109
109
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
-
115
110
echo " ==> starting promote-release"
116
111
/src/target/release/promote-release /persistent/release " ${channel} "
Original file line number Diff line number Diff line change 5
5
set -euo pipefail
6
6
IFS=$' \n\t '
7
7
8
- RUSTUP_OVERRIDE_VERSION=" ${RUSTUP_OVERRIDE_VERSION:- } "
9
-
10
8
if [[ " $# " -lt 1 ]]; then
11
9
echo " Usage: $0 <release|rustup>"
12
10
exit 1
@@ -50,11 +48,5 @@ if [[ "$(uname)" == "Linux" ]]; then
50
48
cargo build --release
51
49
fi
52
50
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 {
61
61
let head_sha = self . get_commit_sha_for_rustup_release ( ) ?;
62
62
63
63
// 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) ?;
65
65
66
66
// Download the Rustup artifacts from S3
67
67
let dist_dir = self . download_rustup_artifacts ( & head_sha) ?;
@@ -115,16 +115,6 @@ impl Context {
115
115
Ok ( commit. sha )
116
116
}
117
117
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
-
128
118
fn get_next_rustup_version_from_github ( & self , sha : & str ) -> anyhow:: Result < String > {
129
119
println ! ( "Getting next Rustup version from Cargo.toml..." ) ;
130
120
You can’t perform that action at this time.
0 commit comments