mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Windows] Add MySQL to the toolset (#4435)
This commit is contained in:
@@ -11,13 +11,9 @@ $ArgumentList = ("/install", "/quiet", "/norestart")
|
||||
Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
|
||||
## Downloading mysql
|
||||
if (Test-IsWin22) {
|
||||
$MysqlVersionName = "mysql-8.0.26-winx64"
|
||||
$MysqlVersionUrl = "https://dev.mysql.com/get/Downloads/MySQL-8/${MysqlVersionName}.zip"
|
||||
} else {
|
||||
$MysqlVersionName = "mysql-5.7.35-winx64"
|
||||
$MysqlVersionUrl = "https://dev.mysql.com/get/Downloads/MySQL-5.7/${MysqlVersionName}.zip"
|
||||
}
|
||||
$MysqlMajorMinor = (Get-ToolsetContent).Mysql.version
|
||||
$MysqlFullVersion = ((Invoke-WebRequest -Uri https://dev.mysql.com/downloads/mysql/${MysqlMajorMinor}.html).Content | Select-String -Pattern "${MysqlMajorMinor}\.\d+").Matches.Value
|
||||
$MysqlVersionUrl = "https://dev.mysql.com/get/Downloads/MySQL-${MysqlMajorMinor}/mysql-${MysqlFullVersion}-winx64.zip"
|
||||
|
||||
$MysqlArchPath = Start-DownloadWithRetry -Url $MysqlVersionUrl -Name "mysql.zip"
|
||||
|
||||
@@ -26,7 +22,7 @@ Extract-7Zip -Path $MysqlArchPath -DestinationPath "C:\"
|
||||
|
||||
# Rename mysql-version to mysql folder
|
||||
$MysqlPath = "C:\mysql"
|
||||
Rename-Item -Path "C:\${MysqlVersionName}" -NewName $MysqlPath
|
||||
Rename-Item -Path "C:\mysql-${MysqlFullVersion}-winx64" -NewName $MysqlPath
|
||||
|
||||
# Adding mysql in system environment path
|
||||
Add-MachinePathItem "${MysqlPath}\bin"
|
||||
|
||||
Reference in New Issue
Block a user