neiam /action-setup-beam
action-setup-beam
public · Issues · Pulls · Labels · Forks · Compare · Actions queued
⭐
Log in to mark this repository.
Fix "Windows workflow broken since recent commit" (#246)
cf854bf · Paulo F. Oliveira · 2024-01-28 18:52
Files changed
modified
.github/workflows/ubuntu.yml
+5
−5
@@ -197,9 +197,9 @@ jobs:
| 197 | 197 | gleam-version: ${{matrix.combo.gleam-version}} |
| 198 | 198 | rebar3-version: ${{matrix.combo.rebar3-version}} |
| 199 | 199 | - run: env |
| 200 | − - name: List environment variables | |
| 200 | + - name: Check environment variables | |
| 201 | 201 | run: | |
| 202 | − [ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}" | |
| 203 | − [ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}" | |
| 204 | − [ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}" | |
| 205 | − [ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}" | |
| 202 | + ${INSTALL_DIR_FOR_ELIXIR}/elixir --version | |
| 203 | + ${INSTALL_DIR_FOR_GLEAM}/gleam --version | |
| 204 | + ${INSTALL_DIR_FOR_OTP}/erl -version | |
| 205 | + ${INSTALL_DIR_FOR_REBAR3}/rebar3 version |
modified
.github/workflows/windows.yml
+5
−5
@@ -135,10 +135,10 @@ jobs:
| 135 | 135 | gleam-version: ${{matrix.combo.gleam-version}} |
| 136 | 136 | rebar3-version: ${{matrix.combo.rebar3-version}} |
| 137 | 137 | - run: env |
| 138 | − - name: List environment variables | |
| 138 | + - name: Check environment variables | |
| 139 | 139 | run: | |
| 140 | − [ -n "${INSTALL_DIR_FOR_ELIXIR}" ] && echo "${INSTALL_DIR_FOR_ELIXIR}" | |
| 141 | − [ -n "${INSTALL_DIR_FOR_GLEAM}" ] && echo "${INSTALL_DIR_FOR_GLEAM}" | |
| 142 | − [ -n "${INSTALL_DIR_FOR_OTP}" ] && echo "${INSTALL_DIR_FOR_OTP}" | |
| 143 | − [ -n "${INSTALL_DIR_FOR_REBAR3}" ] && echo "${INSTALL_DIR_FOR_REBAR3}" | |
| 140 | + ${INSTALL_DIR_FOR_ELIXIR}/elixir --version | |
| 141 | + ${INSTALL_DIR_FOR_GLEAM}/gleam --version | |
| 142 | + ${INSTALL_DIR_FOR_OTP}/erl -version | |
| 143 | + ${INSTALL_DIR_FOR_REBAR3}/rebar3 version | |
| 144 | 144 | shell: bash |
deleted
dist/.github/elixir-matchers.json
+0
−62
@@ -1,62 +0,0 @@
| 1 | −{ | |
| 2 | − "problemMatcher": [ | |
| 3 | − { | |
| 4 | − "owner": "elixir-mixCompileError", | |
| 5 | − "severity": "error", | |
| 6 | − "pattern": [ | |
| 7 | − { | |
| 8 | − "regexp": "^\\*\\* \\((\\w+)\\) (.*):(\\d+): (.*)$", | |
| 9 | − "file": 2, | |
| 10 | − "line": 3, | |
| 11 | − "message": 0 | |
| 12 | − } | |
| 13 | − ] | |
| 14 | − }, | |
| 15 | − { | |
| 16 | − "owner": "elixir-mixCompileWarning", | |
| 17 | − "severity": "warning", | |
| 18 | − "pattern": [ | |
| 19 | − { | |
| 20 | − "regexp": "^warning: (.*)$", | |
| 21 | − "message": 1 | |
| 22 | − }, | |
| 23 | − { | |
| 24 | − "regexp": "^ (.*):(\\d+).*$", | |
| 25 | − "file": 1, | |
| 26 | − "line": 2 | |
| 27 | − } | |
| 28 | − ] | |
| 29 | − }, | |
| 30 | − { | |
| 31 | − "owner": "elixir-mixTestFailure", | |
| 32 | − "severity": "error", | |
| 33 | − "pattern": [ | |
| 34 | − { | |
| 35 | − "regexp": "^\\s*\\d+\\) (.*)$", | |
| 36 | − "message": 1 | |
| 37 | − }, | |
| 38 | − { | |
| 39 | − "regexp": "^\\s*(.*):(\\d+)$", | |
| 40 | − "file": 1, | |
| 41 | − "line": 2 | |
| 42 | − } | |
| 43 | − ] | |
| 44 | − }, | |
| 45 | − { | |
| 46 | − "owner": "elixir-credoOutputDefault", | |
| 47 | − "severity": "warning", | |
| 48 | − "pattern": [ | |
| 49 | − { | |
| 50 | − "regexp": "^\u2503\\s\\[\\w\\]\\s[\u2191|\u2197|\u2192|\u2198|\u2193]\\s(.*)$", | |
| 51 | − "message": 1 | |
| 52 | − }, | |
| 53 | − { | |
| 54 | − "regexp": "^\u2503\\s{7}(.*):(\\d+):(\\d+)\\s.*$", | |
| 55 | − "file": 1, | |
| 56 | − "line": 2, | |
| 57 | − "column": 3 | |
| 58 | − } | |
| 59 | − ] | |
| 60 | − } | |
| 61 | − ] | |
| 62 | −} |
modified
dist/index.js
+9
−6
@@ -10723,16 +10723,18 @@ async function install(toolName, opts) {
| 10723 | 10723 | postExtract: async (cachePath) => { |
| 10724 | 10724 | const bindir = path.join(cachePath, 'bin') |
| 10725 | 10725 | const oldPath = path.join(cachePath, 'rebar3') |
| 10726 | + const newPath = path.join(bindir, 'rebar3') | |
| 10726 | 10727 | fs.mkdirSync(bindir) |
| 10727 | − fs.chmodSync(oldPath, 0o755) | |
| 10728 | + fs.renameSync(oldPath, newPath) | |
| 10729 | + fs.chmodSync(newPath, 0o755) | |
| 10728 | 10730 | |
| 10729 | 10731 | const ps1Filename = path.join(bindir, 'rebar3.ps1') |
| 10730 | − fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`) | |
| 10732 | + fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`) | |
| 10731 | 10733 | |
| 10732 | 10734 | const cmdFilename = path.join(bindir, 'rebar3.cmd') |
| 10733 | 10735 | fs.writeFileSync( |
| 10734 | 10736 | cmdFilename, |
| 10735 | − `@echo off\r\nescript.exe ${oldPath} %*`, | |
| 10737 | + `@echo off\r\nescript.exe ${newPath} %*`, | |
| 10736 | 10738 | ) |
| 10737 | 10739 | }, |
| 10738 | 10740 | reportVersion: () => { |
@@ -10776,11 +10778,12 @@ async function installTool(opts) {
| 10776 | 10778 | await platformOpts.postExtract(cachePath) |
| 10777 | 10779 | |
| 10778 | 10780 | core.debug(`Adding ${cachePath}'s bin to system path`) |
| 10779 | − core.addPath(path.join(cachePath, 'bin')) | |
| 10781 | + const catchPathBin = path.join(cachePath, 'bin') | |
| 10782 | + core.addPath(catchPathBin) | |
| 10780 | 10783 | |
| 10781 | 10784 | const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() |
| 10782 | − core.debug(`Exporting ${installDirForVarName} as ${cachePath}`) | |
| 10783 | − core.exportVariable(installDirForVarName, cachePath) | |
| 10785 | + core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`) | |
| 10786 | + core.exportVariable(installDirForVarName, catchPathBin) | |
| 10784 | 10787 | |
| 10785 | 10788 | core.info(`Installed ${installOpts.tool} version`) |
| 10786 | 10789 | const [cmd, args] = platformOpts.reportVersion() |
deleted
dist/install-gleam.ps1
+0
−37
@@ -1,37 +0,0 @@
| 1 | −param([Parameter(Mandatory=$true)][string]${VSN}) | |
| 2 | − | |
| 3 | −$ErrorActionPreference="Stop" | |
| 4 | − | |
| 5 | −Set-Location ${Env:RUNNER_TEMP} | |
| 6 | − | |
| 7 | −$FILE_OUTPUT="gleam.zip" | |
| 8 | −$DIR_FOR_BIN=".setup-beam/gleam" | |
| 9 | − | |
| 10 | −function Version-Greater-Than([string]${THIS_ONE}, [string]${REFERENCE}) { | |
| 11 | − $THIS_ONE=$THIS_ONE.replace('v', '') | |
| 12 | − $THIS_ONE=$THIS_ONE.replace('rc', '') | |
| 13 | − $THIS_ONE=$THIS_ONE.replace('-', '') | |
| 14 | − return [version]${THIS_ONE} -gt [version]${REFERENCE} | |
| 15 | −} | |
| 16 | − | |
| 17 | −function Uses-LLVM-Triplets([string]${THIS_VSN}) { | |
| 18 | − return "${THIS_VSN}" -eq "nightly" -or (Version-Greater-Than "${THIS_VSN}" "0.22.1") | |
| 19 | −} | |
| 20 | − | |
| 21 | −if (Uses-LLVM-Triplets "$VSN") { | |
| 22 | − $FILE_INPUT="gleam-${VSN}-x86_64-pc-windows-msvc.zip" | |
| 23 | −} else { | |
| 24 | − $FILE_INPUT="gleam-${VSN}-windows-64bit.zip" | |
| 25 | −} | |
| 26 | − | |
| 27 | −$ProgressPreference="SilentlyContinue" | |
| 28 | −Invoke-WebRequest "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}" | |
| 29 | −$ProgressPreference="Continue" | |
| 30 | −New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null | |
| 31 | −$ProgressPreference="SilentlyContinue" | |
| 32 | −Expand-Archive -DestinationPath "${DIR_FOR_BIN}/bin" -Path "${FILE_OUTPUT}" | |
| 33 | −$ProgressPreference="Continue" | |
| 34 | −Write-Output "Installed Gleam version follows" | |
| 35 | −& "${DIR_FOR_BIN}/bin/gleam" "--version" | Write-Output | |
| 36 | − | |
| 37 | −"INSTALL_DIR_FOR_GLEAM=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append |
deleted
dist/install-gleam.sh
+0
−35
@@ -1,35 +0,0 @@
| 1 | −#!/bin/bash | |
| 2 | − | |
| 3 | −set -eo pipefail | |
| 4 | − | |
| 5 | −cd "${RUNNER_TEMP}" | |
| 6 | − | |
| 7 | −VSN="$1" | |
| 8 | −FILE_OUTPUT=gleam.tar.gz | |
| 9 | −DIR_FOR_BIN=.setup-beam/gleam | |
| 10 | − | |
| 11 | −version_gt() { | |
| 12 | − REFERENCE=$1 | |
| 13 | − test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$REFERENCE" | |
| 14 | −} | |
| 15 | − | |
| 16 | −uses_llvm_triplets() { | |
| 17 | − local VERSION="$1" | |
| 18 | − test "${VERSION}" = "nightly" || version_gt "${VERSION}" "v0.22.1" | |
| 19 | −} | |
| 20 | − | |
| 21 | −if uses_llvm_triplets "$VSN" | |
| 22 | −then | |
| 23 | − FILE_INPUT="gleam-${VSN}-x86_64-unknown-linux-musl.tar.gz" | |
| 24 | −else | |
| 25 | − FILE_INPUT="gleam-${VSN}-linux-amd64.tar.gz" | |
| 26 | −fi | |
| 27 | − | |
| 28 | −wget -q -O "${FILE_OUTPUT}" "https://github.com/gleam-lang/gleam/releases/download/${VSN}/${FILE_INPUT}" | |
| 29 | −mkdir -p "${DIR_FOR_BIN}/bin" | |
| 30 | −tar zxf "${FILE_OUTPUT}" -C "${DIR_FOR_BIN}/bin" | |
| 31 | − | |
| 32 | −echo "Installed Gleam version follows" | |
| 33 | −${DIR_FOR_BIN}/bin/gleam --version | |
| 34 | − | |
| 35 | −echo "INSTALL_DIR_FOR_GLEAM=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}" |
deleted
dist/install-rebar3.ps1
+0
−32
@@ -1,32 +0,0 @@
| 1 | −param([Parameter(Mandatory=$true)][string]${VSN}) | |
| 2 | − | |
| 3 | −$ErrorActionPreference="Stop" | |
| 4 | − | |
| 5 | −Set-Location ${Env:RUNNER_TEMP} | |
| 6 | − | |
| 7 | −$FILE_INPUT="rebar3" | |
| 8 | −$FILE_OUTPUT="rebar3" | |
| 9 | −$FILE_OUTPUT_PS1="rebar3.ps1" | |
| 10 | −$FILE_OUTPUT_CMD="rebar3.cmd" | |
| 11 | −$DIR_FOR_BIN=".setup-beam/rebar3" | |
| 12 | − | |
| 13 | −$ProgressPreference="SilentlyContinue" | |
| 14 | −$REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}" | |
| 15 | −$REBAR3_NIGHTLY="" | |
| 16 | −If ( ${VSN} -eq "nightly" ) | |
| 17 | −{ | |
| 18 | − $REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3" | |
| 19 | − $REBAR3_NIGHTLY=" (from nightly build)" | |
| 20 | −} | |
| 21 | −Invoke-WebRequest "${REBAR3_TARGET}" -OutFile "${FILE_OUTPUT}" | |
| 22 | −$ProgressPreference="Continue" | |
| 23 | −New-Item "${DIR_FOR_BIN}/bin" -ItemType Directory | Out-Null | |
| 24 | −Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin" | |
| 25 | −Write-Output "& escript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} `${args}" | Out-File -FilePath "${FILE_OUTPUT_PS1}" -Encoding utf8 -Append | |
| 26 | −Write-Output "@echo off`r`nescript.exe ${PWD}/${DIR_FOR_BIN}/bin/${FILE_OUTPUT} %*" | Out-File -FilePath "${FILE_OUTPUT_CMD}" -Encoding utf8 -Append | |
| 27 | −Move-Item "${FILE_OUTPUT_PS1}" "${DIR_FOR_BIN}/bin" | |
| 28 | −Move-Item "${FILE_OUTPUT_CMD}" "${DIR_FOR_BIN}/bin" | |
| 29 | −Write-Output "Installed rebar3 version${REBAR3_NIGHTLY} follows" | |
| 30 | −& "${DIR_FOR_BIN}/bin/rebar3.cmd" "version" | Write-Output | |
| 31 | − | |
| 32 | −"INSTALL_DIR_FOR_REBAR3=${Env:RUNNER_TEMP}/${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append |
deleted
dist/install-rebar3.sh
+0
−25
@@ -1,25 +0,0 @@
| 1 | −#!/bin/bash | |
| 2 | − | |
| 3 | −set -eo pipefail | |
| 4 | − | |
| 5 | −cd "${RUNNER_TEMP}" | |
| 6 | − | |
| 7 | −VSN=${1} | |
| 8 | −FILE_INPUT=rebar3 | |
| 9 | −FILE_OUTPUT=rebar3 | |
| 10 | −DIR_FOR_BIN=.setup-beam/rebar3 | |
| 11 | − | |
| 12 | −REBAR3_TARGET="https://github.com/erlang/rebar3/releases/download/${VSN}/${FILE_INPUT}" | |
| 13 | −REBAR3_NIGHTLY="" | |
| 14 | −if [ "${VSN}" == "nightly" ]; then | |
| 15 | − REBAR3_TARGET="https://s3.amazonaws.com/rebar3-nightly/rebar3" | |
| 16 | − REBAR3_NIGHTLY=" (from nightly build)" | |
| 17 | −fi | |
| 18 | −wget -q -O "${FILE_OUTPUT}" "${REBAR3_TARGET}" | |
| 19 | −mkdir -p "${DIR_FOR_BIN}/bin" | |
| 20 | −chmod +x "${FILE_OUTPUT}" | |
| 21 | −mv "${FILE_OUTPUT}" "${DIR_FOR_BIN}/bin" | |
| 22 | −echo "Installed rebar3 version${REBAR3_NIGHTLY} follows" | |
| 23 | −${DIR_FOR_BIN}/bin/rebar3 version | |
| 24 | − | |
| 25 | −echo "INSTALL_DIR_FOR_REBAR3=${RUNNER_TEMP}/${DIR_FOR_BIN}" >> "${GITHUB_ENV}" |
modified
src/setup-beam.js
+9
−6
@@ -903,16 +903,18 @@ async function install(toolName, opts) {
| 903 | 903 | postExtract: async (cachePath) => { |
| 904 | 904 | const bindir = path.join(cachePath, 'bin') |
| 905 | 905 | const oldPath = path.join(cachePath, 'rebar3') |
| 906 | + const newPath = path.join(bindir, 'rebar3') | |
| 906 | 907 | fs.mkdirSync(bindir) |
| 907 | − fs.chmodSync(oldPath, 0o755) | |
| 908 | + fs.renameSync(oldPath, newPath) | |
| 909 | + fs.chmodSync(newPath, 0o755) | |
| 908 | 910 | |
| 909 | 911 | const ps1Filename = path.join(bindir, 'rebar3.ps1') |
| 910 | − fs.writeFileSync(ps1Filename, `& escript.exe ${oldPath} \${args}`) | |
| 912 | + fs.writeFileSync(ps1Filename, `& escript.exe ${newPath} \${args}`) | |
| 911 | 913 | |
| 912 | 914 | const cmdFilename = path.join(bindir, 'rebar3.cmd') |
| 913 | 915 | fs.writeFileSync( |
| 914 | 916 | cmdFilename, |
| 915 | − `@echo off\r\nescript.exe ${oldPath} %*`, | |
| 917 | + `@echo off\r\nescript.exe ${newPath} %*`, | |
| 916 | 918 | ) |
| 917 | 919 | }, |
| 918 | 920 | reportVersion: () => { |
@@ -956,11 +958,12 @@ async function installTool(opts) {
| 956 | 958 | await platformOpts.postExtract(cachePath) |
| 957 | 959 | |
| 958 | 960 | core.debug(`Adding ${cachePath}'s bin to system path`) |
| 959 | − core.addPath(path.join(cachePath, 'bin')) | |
| 961 | + const catchPathBin = path.join(cachePath, 'bin') | |
| 962 | + core.addPath(catchPathBin) | |
| 960 | 963 | |
| 961 | 964 | const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase() |
| 962 | − core.debug(`Exporting ${installDirForVarName} as ${cachePath}`) | |
| 963 | − core.exportVariable(installDirForVarName, cachePath) | |
| 965 | + core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`) | |
| 966 | + core.exportVariable(installDirForVarName, catchPathBin) | |
| 964 | 967 | |
| 965 | 968 | core.info(`Installed ${installOpts.tool} version`) |
| 966 | 969 | const [cmd, args] = platformOpts.reportVersion() |
Parents: 4a641b1