@@ -249,57 +249,12 @@ jobs:
249249 - name : Upgrade Chocolaty on Windows 2019
250250 if : matrix.os == 'windows-2019'
251251 shell : powershell
252- run : |
253- Write-Output '::group::Update chocolaty'
254- choco upgrade -y chocolatey
255- Write-Output '::endgroup::'
256-
257- if ( $LASTEXITCODE ) {
258- Write-Output '::error::Could not update chocolatey.'
259- exit $LASTEXITCODE
260- }
252+ run : .\script\setup\upgrade_chocolaty_windows_2019.ps1
261253
262254 - name : Upgrade MinGW on Windows 2019
263255 if : matrix.os == 'windows-2019'
264256 shell : powershell
265- run : |
266- # Add retry and backoff
267- foreach ( $i in 1..3 ) {
268- Write-Output "::group::Attempt $i"
269- if ( $i -gt 1 ) {
270- # remove any left-over state
271- choco uninstall -y --no-progress --force mingw
272-
273- Write-Output 'Sleeping for 60 seconds'
274- Sleep -Seconds 60
275- }
276-
277- Write-Output 'manually force remove C:\mingw64'
278- Remove-Item -Path "C:\mingw64" -Recurse -Force -ErrorAction Ignore
279-
280- choco install -y --no-progress --stop-on-first-failure --force mingw --allow-downgrade --version 12.2.0.3042023
281- Write-Output '::endgroup::'
282- if ( -not $LASTEXITCODE ) {
283- Write-Output "Attempt $i succeeded (exit code: $LASTEXITCODE)"
284- break
285- }
286- Write-Output "::warning title=mingw::Attempt $i failed (exit code: $LASTEXITCODE)"
287- }
288-
289- if ( $LASTEXITCODE ) {
290- Write-Output "::error::Could not install mingw after $i attempts."
291- exit $LASTEXITCODE
292- }
293-
294- # Copy to default path
295- Copy-Item -Path "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64" -Destination "C:\mingw64" -Recurse -Force
296-
297- # Copy as make.exe
298- $path = "C:\mingw64\bin\mingw32-make.exe" | Get-Item
299- Copy-Item -Path $path.FullName -Destination (Join-Path $path.Directory.FullName 'make.exe') -Force
300-
301- # verify mingw32-make was installed
302- Get-Command -CommandType Application -ErrorAction Stop mingw32-make.exe
257+ run : .\script\setup\upgrade_mingw_windows_2019.ps1
303258
304259 - name : Binaries
305260 shell : bash
0 commit comments