Compare commits

..

8 Commits

Author SHA1 Message Date
GitHub Actions 8b9cac4c04 Automation: update setup-beam version output to 6c8deb6 2024-01-31 08:24:47 +00:00
Andrew Shu 6c8deb6007 Update action.yml to use node20 (was node16) (#249) 2024-01-31 08:24:20 +00:00
Paulo F. Oliveira 98ca4dce66 Have npm run build-dist _always_ recreate dist (#247) 2024-01-28 16:45:05 -06:00
GitHub Actions b8913643d6 Automation: update setup-beam version output to cf854bf 2024-01-28 18:53:13 +00:00
Paulo F. Oliveira cf854bf149 Fix "Windows workflow broken since recent commit" (#246) 2024-01-28 12:52:46 -06:00
GitHub Actions 4a641b1000 Automation: update setup-beam version output to 07193a0 2024-01-28 18:52:29 +00:00
Paulo F. Oliveira 07193a0ba2 Update outdated/deprecated actions (#244) 2024-01-28 12:52:05 -06:00
GitHub Actions 4c35984bbc Automation: update setup-beam version output to b60baf4 2024-01-25 22:07:33 +00:00
17 changed files with 60 additions and 245 deletions
+10 -10
View File
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Version it!
run: |
# We expect a string such as const setupBeamVersion = 'undefined' in the code
@@ -32,10 +32,10 @@ jobs:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
- run: npm run build-dist
- name: Check if build left artifacts
run: git diff --exit-code --ignore-space-at-eol
@@ -44,10 +44,10 @@ jobs:
name: Unit tests (Ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
- run: npm ci
- run: npm test
- name: .tool-versions test
@@ -61,9 +61,9 @@ jobs:
name: Unit tests (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
- run: npm install --production
- run: npm test
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
install-rebar: [true, false]
install-hex: [true, false]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
+7 -7
View File
@@ -120,7 +120,7 @@ jobs:
escript_script: 'protoc-gen-elixir --version'
os: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
@@ -187,7 +187,7 @@ jobs:
rebar3-version: 'nightly'
os: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
@@ -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
@@ -11,7 +11,7 @@ jobs:
name: Update 3rd party licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run:
./.github/workflows/update_3rd_party_licenses.sh
env:
+7 -7
View File
@@ -59,7 +59,7 @@ jobs:
escript_script: 'protoc-gen-elixir --version'
os: 'windows-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
@@ -125,7 +125,7 @@ jobs:
rebar3-version: 'nightly'
os: 'windows-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use erlef/setup-beam
id: setup-beam
uses: ./
@@ -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
+8 -8
View File
@@ -83,7 +83,7 @@ jobs:
env:
ImageOS: ubuntu20 # equivalent to runs-on ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
...
```
@@ -143,7 +143,7 @@ jobs:
otp: ['20.3', '21.3', '22.2']
elixir: ['1.8.2', '1.9.4']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
@@ -167,7 +167,7 @@ jobs:
otp: ['20.3', '21.3', '22.2']
rebar3: ['3.14.1', '3.14.3']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
@@ -185,7 +185,7 @@ jobs:
test:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '24'
@@ -203,7 +203,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '24'
@@ -221,7 +221,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: false
@@ -245,7 +245,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '25'
@@ -263,7 +263,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '25'
+1 -1
View File
@@ -61,5 +61,5 @@ outputs:
setup-beam-version:
description: The commit unique id of the execution action version
runs:
using: node16
using: node20
main: dist/index.js
-62
View File
@@ -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
}
]
}
]
}
+10 -7
View File
@@ -9874,7 +9874,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = 'bc84950'
const setupBeamVersion = '6c8deb6'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -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()
-37
View File
@@ -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
-35
View File
@@ -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}"
-32
View File
@@ -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
-25
View File
@@ -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}"
+1 -1
View File
@@ -23,7 +23,7 @@
"yarn": "1.22.19"
},
"engines": {
"node": ">=16"
"node": ">=20"
}
},
"node_modules/@actions/core": {
+2 -2
View File
@@ -11,7 +11,7 @@
"shellcheck": "shellcheck .github/workflows/*.sh",
"test": "node test/setup-beam.test.js",
"yamllint": "yamllint .github/workflows/**.yml && yamllint .*.yml && yamllint *.yml",
"build-dist": "npm install && npm run build && npm run format && npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint"
"build-dist": "rm -rf ./dist && npm install && npm run build && npm run format && npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint"
},
"dependencies": {
"@actions/core": "1.10.0",
@@ -30,6 +30,6 @@
"yarn": "1.22.19"
},
"engines": {
"node": ">=16"
"node": ">=20"
}
}
+10 -7
View File
@@ -49,7 +49,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = 'bc84950'
const setupBeamVersion = '6c8deb6'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -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()
+2 -2
View File
@@ -11,8 +11,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1.9.0
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "23.2"
gleam-version: "0.23.0-rc1"