mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-29 03:00:49 +00:00
Check behaviour on Windows pre- Gleam 0.23 (#166)
* Check behaviour on Windows pre- Gleam 0.23 * Increase consistency with .sh counterpart * Support older versions (pre 0.22.1) on Windows * Increase inter-script consistency * Run `npm run build-dist` * React to CI results
This commit is contained in:
@@ -41,9 +41,11 @@ jobs:
|
|||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
rebar3-version: '3.15'
|
rebar3-version: '3.15'
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
|
- gleam-version: '0.19.0-rc3'
|
||||||
|
otp-version: '24'
|
||||||
|
os: 'windows-latest'
|
||||||
- gleam-version: '0.23.0-rc1'
|
- gleam-version: '0.23.0-rc1'
|
||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
rebar3-version: '3.16'
|
|
||||||
os: 'windows-latest'
|
os: 'windows-latest'
|
||||||
- elixir-version: 'v1.13'
|
- elixir-version: 'v1.13'
|
||||||
otp-version: '24'
|
otp-version: '24'
|
||||||
|
|||||||
Vendored
+17
-1
@@ -4,10 +4,26 @@ $ErrorActionPreference="Stop"
|
|||||||
|
|
||||||
Set-Location ${Env:RUNNER_TEMP}
|
Set-Location ${Env:RUNNER_TEMP}
|
||||||
|
|
||||||
$FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip"
|
|
||||||
$FILE_OUTPUT="gleam.zip"
|
$FILE_OUTPUT="gleam.zip"
|
||||||
$DIR_FOR_BIN=".setup-beam/gleam"
|
$DIR_FOR_BIN=".setup-beam/gleam"
|
||||||
|
|
||||||
|
function Version-Greater-Than([string]${THIS_ONE}, [string]${REFERENCE}) {
|
||||||
|
$THIS_ONE=$THIS_ONE.replace('v', '')
|
||||||
|
$THIS_ONE=$THIS_ONE.replace('rc', '')
|
||||||
|
$THIS_ONE=$THIS_ONE.replace('-', '')
|
||||||
|
return [version]${THIS_ONE} -gt [version]${REFERENCE}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uses-LLVM-Triplets([string]${THIS_VSN}) {
|
||||||
|
return "${THIS_VSN}" -eq "nightly" -or (Version-Greater-Than "${THIS_VSN}" "0.22.1")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Uses-LLVM-Triplets "$VSN") {
|
||||||
|
$FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip"
|
||||||
|
} else {
|
||||||
|
$FILE_INPUT="gleam-${VSN}-windows-64bit.zip"
|
||||||
|
}
|
||||||
|
|
||||||
$ProgressPreference="SilentlyContinue"
|
$ProgressPreference="SilentlyContinue"
|
||||||
Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
||||||
$ProgressPreference="Continue"
|
$ProgressPreference="Continue"
|
||||||
|
|||||||
Vendored
+4
-3
@@ -9,12 +9,13 @@ FILE_OUTPUT=gleam.tar.gz
|
|||||||
DIR_FOR_BIN=.setup-beam/gleam
|
DIR_FOR_BIN=.setup-beam/gleam
|
||||||
|
|
||||||
version_gt() {
|
version_gt() {
|
||||||
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"
|
REFERENCE=$1
|
||||||
|
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$REFERENCE"
|
||||||
}
|
}
|
||||||
|
|
||||||
uses_llvm_triplets() {
|
uses_llvm_triplets() {
|
||||||
local version="$1"
|
local VERSION="$1"
|
||||||
test "$version" = "nightly" || version_gt "$version" "v0.22.1"
|
test "${VERSION}" = "nightly" || version_gt "${VERSION}" "v0.22.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
if uses_llvm_triplets "$VSN"
|
if uses_llvm_triplets "$VSN"
|
||||||
|
|||||||
Vendored
+8
-5
@@ -4,14 +4,17 @@ $ErrorActionPreference="Stop"
|
|||||||
|
|
||||||
Set-Location ${Env:RUNNER_TEMP}
|
Set-Location ${Env:RUNNER_TEMP}
|
||||||
|
|
||||||
|
$FILE_INPUT="otp_win64_${VSN}.exe"
|
||||||
$FILE_OUTPUT="otp.exe"
|
$FILE_OUTPUT="otp.exe"
|
||||||
$ERL_ROOT = "${Env:RUNNER_TEMP}\.setup-beam\otp"
|
$DIR_FOR_BIN="${Env:RUNNER_TEMP}\.setup-beam\otp"
|
||||||
|
|
||||||
$ProgressPreference="SilentlyContinue"
|
$ProgressPreference="SilentlyContinue"
|
||||||
Invoke-WebRequest "https://github.com/erlang/otp/releases/download/OTP-${VSN}/otp_win64_${VSN}.exe" -OutFile "${FILE_OUTPUT}"
|
Invoke-WebRequest "https://github.com/erlang/otp/releases/download/OTP-${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
||||||
$ProgressPreference="Continue"
|
$ProgressPreference="Continue"
|
||||||
Start-Process "${FILE_OUTPUT}" "/S /D=${ERL_ROOT}" -Wait
|
New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
|
||||||
|
$ProgressPreference="SilentlyContinue"
|
||||||
|
Start-Process "${FILE_OUTPUT}" "/S /D=${DIR_FOR_BIN}" -Wait
|
||||||
Write-Output "Installed Erlang/OTP version follows"
|
Write-Output "Installed Erlang/OTP version follows"
|
||||||
& "${ERL_ROOT}/bin/erl.exe" "+V" | Write-Output
|
& "${DIR_FOR_BIN}/bin/erl.exe" "+V" | Write-Output
|
||||||
|
|
||||||
"INSTALL_DIR_FOR_OTP=${ERL_ROOT}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
"INSTALL_DIR_FOR_OTP=${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
||||||
|
|||||||
+17
-1
@@ -4,10 +4,26 @@ $ErrorActionPreference="Stop"
|
|||||||
|
|
||||||
Set-Location ${Env:RUNNER_TEMP}
|
Set-Location ${Env:RUNNER_TEMP}
|
||||||
|
|
||||||
$FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip"
|
|
||||||
$FILE_OUTPUT="gleam.zip"
|
$FILE_OUTPUT="gleam.zip"
|
||||||
$DIR_FOR_BIN=".setup-beam/gleam"
|
$DIR_FOR_BIN=".setup-beam/gleam"
|
||||||
|
|
||||||
|
function Version-Greater-Than([string]${THIS_ONE}, [string]${REFERENCE}) {
|
||||||
|
$THIS_ONE=$THIS_ONE.replace('v', '')
|
||||||
|
$THIS_ONE=$THIS_ONE.replace('rc', '')
|
||||||
|
$THIS_ONE=$THIS_ONE.replace('-', '')
|
||||||
|
return [version]${THIS_ONE} -gt [version]${REFERENCE}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Uses-LLVM-Triplets([string]${THIS_VSN}) {
|
||||||
|
return "${THIS_VSN}" -eq "nightly" -or (Version-Greater-Than "${THIS_VSN}" "0.22.1")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Uses-LLVM-Triplets "$VSN") {
|
||||||
|
$FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip"
|
||||||
|
} else {
|
||||||
|
$FILE_INPUT="gleam-${VSN}-windows-64bit.zip"
|
||||||
|
}
|
||||||
|
|
||||||
$ProgressPreference="SilentlyContinue"
|
$ProgressPreference="SilentlyContinue"
|
||||||
Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
||||||
$ProgressPreference="Continue"
|
$ProgressPreference="Continue"
|
||||||
|
|||||||
@@ -9,12 +9,13 @@ FILE_OUTPUT=gleam.tar.gz
|
|||||||
DIR_FOR_BIN=.setup-beam/gleam
|
DIR_FOR_BIN=.setup-beam/gleam
|
||||||
|
|
||||||
version_gt() {
|
version_gt() {
|
||||||
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"
|
REFERENCE=$1
|
||||||
|
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$REFERENCE"
|
||||||
}
|
}
|
||||||
|
|
||||||
uses_llvm_triplets() {
|
uses_llvm_triplets() {
|
||||||
local version="$1"
|
local VERSION="$1"
|
||||||
test "$version" = "nightly" || version_gt "$version" "v0.22.1"
|
test "${VERSION}" = "nightly" || version_gt "${VERSION}" "v0.22.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
if uses_llvm_triplets "$VSN"
|
if uses_llvm_triplets "$VSN"
|
||||||
|
|||||||
+8
-5
@@ -4,14 +4,17 @@ $ErrorActionPreference="Stop"
|
|||||||
|
|
||||||
Set-Location ${Env:RUNNER_TEMP}
|
Set-Location ${Env:RUNNER_TEMP}
|
||||||
|
|
||||||
|
$FILE_INPUT="otp_win64_${VSN}.exe"
|
||||||
$FILE_OUTPUT="otp.exe"
|
$FILE_OUTPUT="otp.exe"
|
||||||
$ERL_ROOT = "${Env:RUNNER_TEMP}\.setup-beam\otp"
|
$DIR_FOR_BIN="${Env:RUNNER_TEMP}\.setup-beam\otp"
|
||||||
|
|
||||||
$ProgressPreference="SilentlyContinue"
|
$ProgressPreference="SilentlyContinue"
|
||||||
Invoke-WebRequest "https://github.com/erlang/otp/releases/download/OTP-${VSN}/otp_win64_${VSN}.exe" -OutFile "${FILE_OUTPUT}"
|
Invoke-WebRequest "https://github.com/erlang/otp/releases/download/OTP-${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
|
||||||
$ProgressPreference="Continue"
|
$ProgressPreference="Continue"
|
||||||
Start-Process "${FILE_OUTPUT}" "/S /D=${ERL_ROOT}" -Wait
|
New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
|
||||||
|
$ProgressPreference="SilentlyContinue"
|
||||||
|
Start-Process "${FILE_OUTPUT}" "/S /D=${DIR_FOR_BIN}" -Wait
|
||||||
Write-Output "Installed Erlang/OTP version follows"
|
Write-Output "Installed Erlang/OTP version follows"
|
||||||
& "${ERL_ROOT}/bin/erl.exe" "+V" | Write-Output
|
& "${DIR_FOR_BIN}/bin/erl.exe" "+V" | Write-Output
|
||||||
|
|
||||||
"INSTALL_DIR_FOR_OTP=${ERL_ROOT}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
"INSTALL_DIR_FOR_OTP=${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
||||||
|
|||||||
Reference in New Issue
Block a user