diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index e61334a5..174c68cb 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -195,8 +195,8 @@ jobs: if: matrix.os == 'ubuntu-20.04' && matrix.arch != '' - name: Install MSYS2 & libgit2 (Windows) - shell: cmd - run: .\build.bat all + shell: pwsh + run: .\build.ps1 all if: matrix.os == 'windows-latest' - name: Install pkg-config (macOS) diff --git a/build.bat b/build.bat deleted file mode 100644 index 33c71431..00000000 --- a/build.bat +++ /dev/null @@ -1,51 +0,0 @@ -@ECHO OFF - -IF "%1"=="install" goto Install -IF "%1"=="build" goto Build -IF "%1"=="all" goto All -IF "%1"=="" goto Error ELSE goto Error - -:Install - -if exist C:\MSYS64\ ( - echo "MSYS2 already installed" -) else ( - mkdir temp_install & cd temp_install - - echo "Downloading MSYS2..." - curl -L https://github.com/msys2/msys2-installer/releases/download/2022-06-03/msys2-x86_64-20220603.exe > msys2-x86_64-20220603.exe - - echo "Installing MSYS2..." - msys2-x86_64-20220603.exe install --root C:\MSYS64 --confirm-command - - cd .. && rmdir /s /q temp_install -) - - -echo "Adding MSYS2 to path..." -SET "PATH=C:\MSYS64\mingw64\bin;C:\MSYS64\usr\bin;%PATH%" -echo %PATH% - -echo "Installing MSYS2 packages..." -pacman -S --needed --noconfirm make -pacman -S --needed --noconfirm mingw-w64-x86_64-cmake -pacman -S --needed --noconfirm mingw-w64-x86_64-gcc -pacman -S --needed --noconfirm mingw-w64-x86_64-pkg-config -pacman -S --needed --noconfirm msys2-w32api-runtime - -IF "%1"=="all" GOTO Build -GOTO End - -:Build -SET "PATH=C:\MSYS2\mingw64\bin;C:\MSYS2\usr\bin;%PATH%" -make libgit2 -GOTO End - -:All -GOTO Install - -:Error -echo "Error: Unknown option" -GOTO End - -:End diff --git a/build.ps1 b/build.ps1 index 75fc2c88..7b4e0fa7 100644 --- a/build.ps1 +++ b/build.ps1 @@ -30,24 +30,25 @@ function Install { # Install MSYS Write-Host "Installing MSYS2..." -ForegroundColor Cyan - Start-Process -Filepath "$PSScriptRoot\temp_install\msys2-x86_64-20220603.exe" -ArgumentList @("install", "--root", "C:\MSYS64", "--confirm-command") -Wait -NoNewWindow + Start-Process -Filepath "$PSScriptRoot\temp_install\msys2-x86_64-20220603.exe" -ArgumentList @("install", "--root", "C:\MSYS64", "--confirm-command") -Wait Write-Host "MSYS2 install complete" -ForegroundColor Green - # Set PATH - $env:Path = "C:\MSYS64\mingw64\bin;C:\MSYS64\usr\bin;" + $env:Path - - # Install MSYS packages - Write-Host "Installing MSYS2 packages..." -ForegroundColor Cyan - Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "make") -Wait -NoNewWindow - Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "mingw-w64-x86_64-cmake") -Wait -NoNewWindow - Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "mingw-w64-x86_64-gcc") -Wait -NoNewWindow - Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "mingw-w64-x86_64-pkg-config") -Wait -NoNewWindow - Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "msys2-w32api-runtime") -Wait -NoNewWindow - Write-Host "MSYS2 packages install complete" -ForegroundColor Green - # Remove temp directory Remove-Item "$PSScriptRoot\temp_install" -Recurse } + + # Set PATH + $env:Path = "C:\MSYS64\mingw64\bin;C:\MSYS64\usr\bin;" + $env:Path + + # Install MSYS packages + Write-Host "Installing MSYS2 packages..." -ForegroundColor Cyan + Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "make") -Wait + Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "mingw-w64-x86_64-cmake") -Wait + Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "mingw-w64-x86_64-gcc") -Wait + Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "mingw-w64-x86_64-pkg-config") -Wait + Start-Process -Filepath "pacman" -ArgumentList @("-S", "--needed", "--noconfirm", "msys2-w32api-runtime") -Wait + Write-Host "MSYS2 packages install complete" -ForegroundColor Green + Write-Host "Install complete" -ForegroundColor Green }