diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 998194a7..c1bd3a79 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -197,9 +197,9 @@ jobs: gleam-version: ${{matrix.combo.gleam-version}} rebar3-version: ${{matrix.combo.rebar3-version}} - run: env - - name: List environment variables + - name: Check environment variables run: | - [ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}" - [ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}" - [ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}" - [ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}" + ${INSTALL_DIR_FOR_ELIXIR}/elixir --version + ${INSTALL_DIR_FOR_GLEAM}/gleam --version + ${INSTALL_DIR_FOR_OTP}/erl -version + ${INSTALL_DIR_FOR_REBAR3}/rebar3 version diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9fc54af4..0e7f187e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -135,10 +135,10 @@ jobs: gleam-version: ${{matrix.combo.gleam-version}} rebar3-version: ${{matrix.combo.rebar3-version}} - run: env - - name: List environment variables + - name: Check environment variables run: | - [ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}" - [ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}" - [ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}" - [ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}" + ${INSTALL_DIR_FOR_ELIXIR}/elixir --version + ${INSTALL_DIR_FOR_GLEAM}/gleam --version + ${INSTALL_DIR_FOR_OTP}/erl -version + ${INSTALL_DIR_FOR_REBAR3}/rebar3 version shell: bash diff --git a/dist/.github/elixir-matchers.json b/dist/.github/elixir-matchers.json deleted file mode 100644 index df01df60..00000000 --- a/dist/.github/elixir-matchers.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "elixir-mixCompileError", - "severity": "error", - "pattern": [ - { - "regexp": "^\\*\\* \\((\\w+)\\) (.*):(\\d+): (.*)$", - "file": 2, - "line": 3, - "message": 0 - } - ] - }, - { - "owner": "elixir-mixCompileWarning", - "severity": "warning", - "pattern": [ - { - "regexp": "^warning: (.*)$", - "message": 1 - }, - { - "regexp": "^ (.*):(\\d+).*$", - "file": 1, - "line": 2 - } - ] - }, - { - "owner": "elixir-mixTestFailure", - "severity": "error", - "pattern": [ - { - "regexp": "^\\s*\\d+\\) (.*)$", - "message": 1 - }, - { - "regexp": "^\\s*(.*):(\\d+)$", - "file": 1, - "line": 2 - } - ] - }, - { - "owner": "elixir-credoOutputDefault", - "severity": "warning", - "pattern": [ - { - "regexp": "^\u2503\\s\\[\\w\\]\\s[\u2191|\u2197|\u2192|\u2198|\u2193]\\s(.*)$", - "message": 1 - }, - { - "regexp": "^\u2503\\s{7}(.*):(\\d+):(\\d+)\\s.*$", - "file": 1, - "line": 2, - "column": 3 - } - ] - } - ] -} diff --git a/dist/index.js b/dist/index.js index 2974c5c2..65bc7f52 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10723,16 +10723,18 @@ async function install(toolName, opts) { postExtract: async (cachePath) => { const bindir = path.join(cachePath, 'bin') const oldPath = path.join(cachePath, 'rebar3') + const newPath = path.join(bindir, 'rebar3') fs.mkdirSync(bindir) - fs.chmodSync(oldPath, 0o755) + fs.renameSync(oldPath, newPath) + fs.chmodSync(newPath, 0o755) const ps1Filename = path.join(bindir, 'rebar3.ps1') - fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`) + fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`) const cmdFilename = path.join(bindir, 'rebar3.cmd') fs.writeFileSync( cmdFilename, - `@echo off\r\nescript.exe ${oldPath} %*`, + `@echo off\r\nescript.exe ${newPath} %*`, ) }, reportVersion: () => { @@ -10776,11 +10778,12 @@ async function installTool(opts) { await platformOpts.postExtract(cachePath) core.debug(`Adding ${cachePath}'s bin to system path`) - core.addPath(path.join(cachePath, 'bin')) + const catchPathBin = path.join(cachePath, 'bin') + core.addPath(catchPathBin) const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() - core.debug(`Exporting ${installDirForVarName} as ${cachePath}`) - core.exportVariable(installDirForVarName, cachePath) + core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`) + core.exportVariable(installDirForVarName, catchPathBin) core.info(`Installed ${installOpts.tool} version`) const [cmd, args] = platformOpts.reportVersion() diff --git a/dist/install-gleam.ps1 b/dist/install-gleam.ps1 deleted file mode 100644 index 828d1619..00000000 --- a/dist/install-gleam.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -param([Parameter(Mandatory=$true)][string]${VSN}) - -$ErrorActionPreference="Stop" - -Set-Location ${Env:RUNNER_TEMP} - -$FILE_OUTPUT="gleam.zip" -$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" -Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}" -$ProgressPreference="Continue" -New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null -$ProgressPreference="SilentlyContinue" -Expand-Archive -DestinationPath "${DIR_FOR_BIN}/bin" -Path "${FILE_OUTPUT}" -$ProgressPreference="Continue" -Write-Output "Installed Gleam version follows" -& "${DIR_FOR_BIN}/bin/gleam" "--version" | Write-Output - -"INSTALL_DIR_FOR_GLEAM=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append diff --git a/dist/install-gleam.sh b/dist/install-gleam.sh deleted file mode 100755 index 6b060a9f..00000000 --- a/dist/install-gleam.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -cd "${RUNNER_TEMP}" - -VSN="$1" -FILE_OUTPUT=gleam.tar.gz -DIR_FOR_BIN=.setup-beam/gleam - -version_gt() { - REFERENCE=$1 - test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$REFERENCE" -} - -uses_llvm_triplets() { - local VERSION="$1" - test "${VERSION}" = "nightly" || version_gt "${VERSION}" "v0.22.1" -} - -if uses_llvm_triplets "$VSN" -then - FILE_INPUT="gleam-${VSN}-x86_64-unknown-linux-musl.tar.gz" -else - FILE_INPUT="gleam-${VSN}-linux-amd64.tar.gz" -fi - -wget -q -O "${FILE_OUTPUT}" "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -mkdir -p "${DIR_FOR_BIN}/bin" -tar zxf "${FILE_OUTPUT}" -C "${DIR_FOR_BIN}/bin" - -echo "Installed Gleam version follows" -${DIR_FOR_BIN}/bin/gleam --version - -echo "INSTALL_DIR_FOR_GLEAM=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}" diff --git a/dist/install-rebar3.ps1 b/dist/install-rebar3.ps1 deleted file mode 100644 index 7a30982f..00000000 --- a/dist/install-rebar3.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -param([Parameter(Mandatory=$true)][string]${VSN}) - -$ErrorActionPreference="Stop" - -Set-Location ${Env:RUNNER_TEMP} - -$FILE_INPUT="rebar3" -$FILE_OUTPUT="rebar3" -$FILE_OUTPUT_PS1="rebar3.ps1" -$FILE_OUTPUT_CMD="rebar3.cmd" -$DIR_FOR_BIN=".setup-beam/rebar3" - -$ProgressPreference="SilentlyContinue" -$REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}" -$REBAR3_NIGHTLY="" -If ( ${VSN} -eq "nightly" ) -{ - $REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3" - $REBAR3_NIGHTLY=" (from nightly build)" -} -Invoke-WebRequest "${REBAR3_TARGET}" -OutFile "${FILE_OUTPUT}" -$ProgressPreference="Continue" -New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null -Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin" -Write-Output "& escript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} `${args}" | Out-File -FilePath "${FILE_OUTPUT_PS1}" -Encoding utf8 -Append -Write-Output "@echo off`r`nescript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} %*" | Out-File -FilePath "${FILE_OUTPUT_CMD}" -Encoding utf8 -Append -Move-Item "${FILE_OUTPUT_PS1}" "${DIR_FOR_BIN}/bin" -Move-Item "${FILE_OUTPUT_CMD}" "${DIR_FOR_BIN}/bin" -Write-Output "Installed rebar3 version${REBAR3_NIGHTLY} follows" -& "${DIR_FOR_BIN}/bin/rebar3.cmd" "version" | Write-Output - -"INSTALL_DIR_FOR_REBAR3=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append diff --git a/dist/install-rebar3.sh b/dist/install-rebar3.sh deleted file mode 100755 index 6d182de2..00000000 --- a/dist/install-rebar3.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -cd "${RUNNER_TEMP}" - -VSN=${1} -FILE_INPUT=rebar3 -FILE_OUTPUT=rebar3 -DIR_FOR_BIN=.setup-beam/rebar3 - -REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}" -REBAR3_NIGHTLY="" -if [ "${VSN}" == "nightly" ]; then - REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3" - REBAR3_NIGHTLY=" (from nightly build)" -fi -wget -q -O "${FILE_OUTPUT}" "${REBAR3_TARGET}" -mkdir -p "${DIR_FOR_BIN}/bin" -chmod +x "${FILE_OUTPUT}" -mv "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin" -echo "Installed rebar3 version${REBAR3_NIGHTLY} follows" -${DIR_FOR_BIN}/bin/rebar3 version - -echo "INSTALL_DIR_FOR_REBAR3=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}" diff --git a/src/setup-beam.js b/src/setup-beam.js index 78448922..ec03f85c 100644 --- a/src/setup-beam.js +++ b/src/setup-beam.js @@ -903,16 +903,18 @@ async function install(toolName, opts) { postExtract: async (cachePath) => { const bindir = path.join(cachePath, 'bin') const oldPath = path.join(cachePath, 'rebar3') + const newPath = path.join(bindir, 'rebar3') fs.mkdirSync(bindir) - fs.chmodSync(oldPath, 0o755) + fs.renameSync(oldPath, newPath) + fs.chmodSync(newPath, 0o755) const ps1Filename = path.join(bindir, 'rebar3.ps1') - fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`) + fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`) const cmdFilename = path.join(bindir, 'rebar3.cmd') fs.writeFileSync( cmdFilename, - `@echo off\r\nescript.exe ${oldPath} %*`, + `@echo off\r\nescript.exe ${newPath} %*`, ) }, reportVersion: () => { @@ -956,11 +958,12 @@ async function installTool(opts) { await platformOpts.postExtract(cachePath) core.debug(`Adding ${cachePath}'s bin to system path`) - core.addPath(path.join(cachePath, 'bin')) + const catchPathBin = path.join(cachePath, 'bin') + core.addPath(catchPathBin) const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() - core.debug(`Exporting ${installDirForVarName} as ${cachePath}`) - core.exportVariable(installDirForVarName, cachePath) + core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`) + core.exportVariable(installDirForVarName, catchPathBin) core.info(`Installed ${installOpts.tool} version`) const [cmd, args] = platformOpts.reportVersion()