mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-31 19:16:08 +00:00
Install OTP on Windows to a local directory (#139)
This commit is contained in:
Vendored
-9
@@ -7173,7 +7173,6 @@ const { exec } = __nccwpck_require__(1514)
|
|||||||
const path = __nccwpck_require__(1017)
|
const path = __nccwpck_require__(1017)
|
||||||
const semver = __nccwpck_require__(1383)
|
const semver = __nccwpck_require__(1383)
|
||||||
const https = __nccwpck_require__(5687)
|
const https = __nccwpck_require__(5687)
|
||||||
const fs = __nccwpck_require__(7147)
|
|
||||||
const installer = __nccwpck_require__(2127)
|
const installer = __nccwpck_require__(2127)
|
||||||
|
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
@@ -7218,15 +7217,7 @@ async function installOTP(otpSpec, osVersion) {
|
|||||||
)
|
)
|
||||||
await installer.installOTP(osVersion, otpVersion)
|
await installer.installOTP(osVersion, otpVersion)
|
||||||
core.setOutput('otp-version', otpVersion)
|
core.setOutput('otp-version', otpVersion)
|
||||||
if (process.platform === 'linux') {
|
|
||||||
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/otp/bin`)
|
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/otp/bin`)
|
||||||
} else if (process.platform === 'win32') {
|
|
||||||
const otpPath = fs.readFileSync(`${process.env.RUNNER_TEMP}/otp_path.txt`, {
|
|
||||||
encoding: 'utf8',
|
|
||||||
flag: 'r',
|
|
||||||
})
|
|
||||||
core.addPath(otpPath)
|
|
||||||
}
|
|
||||||
console.log('##[endgroup]')
|
console.log('##[endgroup]')
|
||||||
|
|
||||||
return otpVersion
|
return otpVersion
|
||||||
|
|||||||
Vendored
+4
-9
@@ -5,18 +5,13 @@ $ErrorActionPreference="Stop"
|
|||||||
Set-Location ${Env:RUNNER_TEMP}
|
Set-Location ${Env:RUNNER_TEMP}
|
||||||
|
|
||||||
$FILE_OUTPUT="otp.exe"
|
$FILE_OUTPUT="otp.exe"
|
||||||
$DIR_FOR_BIN=".setup-beam/otp"
|
$ERL_ROOT = "${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}/otp_win64_${VSN}.exe" -OutFile "${FILE_OUTPUT}"
|
||||||
$ProgressPreference="Continue"
|
$ProgressPreference="Continue"
|
||||||
New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
|
Start-Process "${FILE_OUTPUT}" "/S /D=${ERL_ROOT}" -Wait
|
||||||
Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}"
|
|
||||||
Start-Process "./${DIR_FOR_BIN}/${FILE_OUTPUT}" /S -Wait
|
|
||||||
$ErlExec = Get-ChildItem -Path "C:/Program Files/" -Recurse -Depth 2 -Filter 'erl.exe' -Name | ForEach-Object { Write-Output "C:/Program Files/$_" }
|
|
||||||
$ErlPath = Split-Path -Path "${ErlExec}"
|
|
||||||
Write-Output "${ErlPath}" | Out-File -FilePath otp_path.txt -Encoding utf8 -NoNewline
|
|
||||||
Write-Output "Installed Erlang/OTP version follows"
|
Write-Output "Installed Erlang/OTP version follows"
|
||||||
& "${ErlPath}/erl.exe" "+V" | Write-Output
|
& "${ERL_ROOT}/bin/erl.exe" "+V" | Write-Output
|
||||||
|
|
||||||
"INSTALL_DIR_FOR_OTP="+(Get-Item ${ErlPath}).parent.FullName | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
"INSTALL_DIR_FOR_OTP=" + ${ERL_ROOT}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -17,4 +17,4 @@ tar zxf "${FILE_OUTPUT}" -C "${DIR_FOR_BIN}" --strip-components=1
|
|||||||
echo "Installed Erlang/OTP version follows"
|
echo "Installed Erlang/OTP version follows"
|
||||||
${DIR_FOR_BIN}/bin/erl -version
|
${DIR_FOR_BIN}/bin/erl -version
|
||||||
|
|
||||||
echo "INSTALL_DIR_FOR_OTP=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
|
echo "INSTALL_DIR_FOR_OTP=${RUNNER_TEMP}/${DIR_FOR_BIN}"
|
||||||
|
|||||||
+4
-9
@@ -5,18 +5,13 @@ $ErrorActionPreference="Stop"
|
|||||||
Set-Location ${Env:RUNNER_TEMP}
|
Set-Location ${Env:RUNNER_TEMP}
|
||||||
|
|
||||||
$FILE_OUTPUT="otp.exe"
|
$FILE_OUTPUT="otp.exe"
|
||||||
$DIR_FOR_BIN=".setup-beam/otp"
|
$ERL_ROOT = "${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}/otp_win64_${VSN}.exe" -OutFile "${FILE_OUTPUT}"
|
||||||
$ProgressPreference="Continue"
|
$ProgressPreference="Continue"
|
||||||
New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
|
Start-Process "${FILE_OUTPUT}" "/S /D=${ERL_ROOT}" -Wait
|
||||||
Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}"
|
|
||||||
Start-Process "./${DIR_FOR_BIN}/${FILE_OUTPUT}" /S -Wait
|
|
||||||
$ErlExec = Get-ChildItem -Path "C:/Program Files/" -Recurse -Depth 2 -Filter 'erl.exe' -Name | ForEach-Object { Write-Output "C:/Program Files/$_" }
|
|
||||||
$ErlPath = Split-Path -Path "${ErlExec}"
|
|
||||||
Write-Output "${ErlPath}" | Out-File -FilePath otp_path.txt -Encoding utf8 -NoNewline
|
|
||||||
Write-Output "Installed Erlang/OTP version follows"
|
Write-Output "Installed Erlang/OTP version follows"
|
||||||
& "${ErlPath}/erl.exe" "+V" | Write-Output
|
& "${ERL_ROOT}/bin/erl.exe" "+V" | Write-Output
|
||||||
|
|
||||||
"INSTALL_DIR_FOR_OTP="+(Get-Item ${ErlPath}).parent.FullName | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
"INSTALL_DIR_FOR_OTP=" + ${ERL_ROOT}
|
||||||
|
|||||||
+1
-1
@@ -17,4 +17,4 @@ tar zxf "${FILE_OUTPUT}" -C "${DIR_FOR_BIN}" --strip-components=1
|
|||||||
echo "Installed Erlang/OTP version follows"
|
echo "Installed Erlang/OTP version follows"
|
||||||
${DIR_FOR_BIN}/bin/erl -version
|
${DIR_FOR_BIN}/bin/erl -version
|
||||||
|
|
||||||
echo "INSTALL_DIR_FOR_OTP=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}"
|
echo "INSTALL_DIR_FOR_OTP=${RUNNER_TEMP}/${DIR_FOR_BIN}"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ const { exec } = require('@actions/exec')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const semver = require('semver')
|
const semver = require('semver')
|
||||||
const https = require('https')
|
const https = require('https')
|
||||||
const fs = require('fs')
|
|
||||||
const installer = require('./installer')
|
const installer = require('./installer')
|
||||||
|
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
@@ -48,15 +47,7 @@ async function installOTP(otpSpec, osVersion) {
|
|||||||
)
|
)
|
||||||
await installer.installOTP(osVersion, otpVersion)
|
await installer.installOTP(osVersion, otpVersion)
|
||||||
core.setOutput('otp-version', otpVersion)
|
core.setOutput('otp-version', otpVersion)
|
||||||
if (process.platform === 'linux') {
|
|
||||||
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/otp/bin`)
|
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/otp/bin`)
|
||||||
} else if (process.platform === 'win32') {
|
|
||||||
const otpPath = fs.readFileSync(`${process.env.RUNNER_TEMP}/otp_path.txt`, {
|
|
||||||
encoding: 'utf8',
|
|
||||||
flag: 'r',
|
|
||||||
})
|
|
||||||
core.addPath(otpPath)
|
|
||||||
}
|
|
||||||
console.log('##[endgroup]')
|
console.log('##[endgroup]')
|
||||||
|
|
||||||
return otpVersion
|
return otpVersion
|
||||||
|
|||||||
Reference in New Issue
Block a user