mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f0cc07b4b | |||
| c36fc0ca1b | |||
| 7c4882bbdd | |||
| cdb7a12eb6 | |||
| 904c511e63 | |||
| 4f558159e6 | |||
| 0430fb6cc6 | |||
| 48f1d0ccc2 | |||
| 4ec4e80c33 | |||
| a23b1fc445 | |||
| eb31c4c998 | |||
| 726c8cb9ac | |||
| 951dd857ae | |||
| f2c1b65313 | |||
| 0352ab2e65 | |||
| 8b9cac4c04 | |||
| 6c8deb6007 | |||
| 98ca4dce66 | |||
| b8913643d6 | |||
| cf854bf149 | |||
| 4a641b1000 | |||
| 07193a0ba2 | |||
| 4c35984bbc |
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: action
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
@@ -12,7 +19,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
|
||||
@@ -27,15 +34,16 @@ jobs:
|
||||
git add dist/index.js
|
||||
git commit -m "Automation: update setup-beam version output to ${SHA}"
|
||||
git push origin main
|
||||
|
||||
check_integrity:
|
||||
name: Expected local npm actions
|
||||
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 +52,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 +69,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,7 +1,14 @@
|
||||
---
|
||||
name: hexpm-mirrors
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
test-failing-first-mirror:
|
||||
@@ -16,7 +23,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: ./
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: ubuntu
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
integration_test:
|
||||
@@ -15,6 +22,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
- otp-version: 'OTP-27.0-rc1'
|
||||
os: 'ubuntu-latest'
|
||||
- otp-version: '26.0'
|
||||
elixir-version: 'v1.14-otp-25'
|
||||
os: 'ubuntu-latest'
|
||||
@@ -120,7 +129,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: ./
|
||||
@@ -174,6 +183,7 @@ jobs:
|
||||
mix escript.install --force ${{matrix.combo.escript_packages}}
|
||||
${{matrix.combo.escript_script}}
|
||||
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
||||
|
||||
environment_variables:
|
||||
name: Environment variables
|
||||
runs-on: ${{matrix.combo.os}}
|
||||
@@ -187,7 +197,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 +207,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}/bin/elixir -v
|
||||
${INSTALL_DIR_FOR_GLEAM}/bin/gleam --version
|
||||
${INSTALL_DIR_FOR_OTP}/bin/erl -version
|
||||
${INSTALL_DIR_FOR_REBAR3}/bin/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:
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: windows
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
integration_test:
|
||||
@@ -15,6 +22,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
combo:
|
||||
- otp-version: 'OTP-27.0-rc1'
|
||||
os: 'windows-latest'
|
||||
- otp-version: '26.0'
|
||||
elixir-version: 'main'
|
||||
os: 'windows-latest'
|
||||
@@ -59,7 +68,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: ./
|
||||
@@ -112,6 +121,7 @@ jobs:
|
||||
mix escript.install --force ${{matrix.combo.escript_packages}}
|
||||
${{matrix.combo.escript_script}}
|
||||
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
||||
|
||||
environment_variables:
|
||||
name: Environment variables
|
||||
runs-on: ${{matrix.combo.os}}
|
||||
@@ -125,7 +135,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 +145,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}"
|
||||
shell: bash
|
||||
& "$Env:INSTALL_DIR_FOR_ELIXIR/bin/elixir" "-v"
|
||||
& "$Env:INSTALL_DIR_FOR_GLEAM/bin/gleam.exe" "--version"
|
||||
& "$Env:INSTALL_DIR_FOR_OTP/bin/erl.exe" "+V"
|
||||
& "$Env:INSTALL_DIR_FOR_REBAR3/bin/rebar3.cmd" "version"
|
||||
& "$Env:INSTALL_DIR_FOR_REBAR3/bin/rebar3.ps1" "version"
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
node_modules/**
|
||||
dist/.github/workflows
|
||||
test/.tool-versions
|
||||
|
||||
+27
-1
@@ -118,7 +118,7 @@ THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: @fastify/busboy. A copy of the source code may be downloaded from https://github.com/fastify/busboy.git. This software contains the following license and notice below:
|
||||
The following software may be included in this product: @fastify/busboy. A copy of the source code may be downloaded from git+https://github.com/fastify/busboy.git. This software contains the following license and notice below:
|
||||
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
@@ -1566,6 +1566,32 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: es-define-property, es-errors. A copy of the source code may be downloaded from git+https://github.com/ljharb/es-define-property.git (es-define-property), git+https://github.com/ljharb/es-errors.git (es-errors). This software contains the following license and notice below:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Jordan Harband
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: es6-error. A copy of the source code may be downloaded from https://github.com/bjyoungblood/es6-error.git. This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -53,9 +53,9 @@ and Erlang/OTP.
|
||||
|- |- |-
|
||||
| ubuntu-18.04 | 17 - 25 | ✅
|
||||
| ubuntu-20.04 | 20 - 25 | ✅
|
||||
| ubuntu-22.04 | 24.2 - 25 | ✅
|
||||
| ubuntu-22.04 | 24.2 - 26 | ✅
|
||||
| windows-2019 | 21* - 25 | ✅
|
||||
| windows-2022 | 21* - 25 | ✅
|
||||
| windows-2022 | 21* - 26 | ✅
|
||||
|
||||
**Note** *: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3, 22.0, etc.
|
||||
|
||||
@@ -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
|
||||
...
|
||||
```
|
||||
@@ -122,11 +122,11 @@ with the following correspondence.
|
||||
#### `.tool-versions` format
|
||||
|
||||
| YML | `.tool-versions` |
|
||||
|- |-
|
||||
| `otp-version` | `erlang`
|
||||
| `elixir-version` | `elixir`
|
||||
| `gleam-version` | `gleam`
|
||||
| `rebar3-version` | `rebar`
|
||||
|- |- |
|
||||
| `otp-version` | `erlang` |
|
||||
| `elixir-version` | `elixir` |
|
||||
| `gleam-version` | `gleam` |
|
||||
| `rebar3-version` | `rebar` |
|
||||
|
||||
### Example (Erlang/OTP + Elixir, on Ubuntu)
|
||||
|
||||
@@ -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,10 +245,10 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '25'
|
||||
otp-version: '26'
|
||||
# Use `cdn.jsdelivr.net/hex` as an alternative to `builds.hex.pm`
|
||||
hexpm-mirrors: https://cdn.jsdelivr.net/hex
|
||||
```
|
||||
@@ -263,10 +263,10 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '25'
|
||||
otp-version: '26'
|
||||
hexpm-mirrors: |
|
||||
https://builds.hex.pm
|
||||
https://cdn.jsdelivr.net/hex
|
||||
@@ -282,6 +282,9 @@ environment variables:
|
||||
- `INSTALL_DIR_FOR_GLEAM`: base folder for Gleam
|
||||
- `INSTALL_DIR_FOR_REBAR3`: base folder for `rebar3`
|
||||
|
||||
In each of these you'll find folder `bin` where the appropriate binaries, platform-dependant,
|
||||
are found (i.e. `erl`, `erl.exe`, `rebar3`, `rebar3.exe`, ...).
|
||||
|
||||
## Elixir Problem Matchers
|
||||
|
||||
The Elixir Problem Matchers in this repository are adapted from
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Vendored
-62
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+472
-441
File diff suppressed because it is too large
Load Diff
Vendored
-37
@@ -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
|
||||
Vendored
-35
@@ -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}"
|
||||
Vendored
-32
@@ -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
|
||||
Vendored
-25
@@ -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}"
|
||||
Generated
+516
-343
File diff suppressed because it is too large
Load Diff
+4
-2
@@ -11,7 +11,9 @@
|
||||
"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"
|
||||
"clean-dist": "rm -rf ./dist",
|
||||
"lint": "npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint",
|
||||
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.10.0",
|
||||
@@ -30,6 +32,6 @@
|
||||
"yarn": "1.22.19"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=20"
|
||||
}
|
||||
}
|
||||
|
||||
+42
-22
@@ -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 = 'c36fc0c'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
@@ -135,7 +135,6 @@ async function maybeInstallGleam(gleamSpec) {
|
||||
core.startGroup(`Installing Gleam ${gleamVersion}`)
|
||||
await install('gleam', { toolVersion: gleamVersion })
|
||||
core.setOutput('gleam-version', gleamVersion)
|
||||
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/gleam/bin`)
|
||||
core.endGroup()
|
||||
|
||||
installed = true
|
||||
@@ -156,7 +155,6 @@ async function maybeInstallRebar3(rebar3Spec) {
|
||||
core.startGroup(`Installing rebar3 ${rebar3Version}`)
|
||||
await install('rebar3', { toolVersion: rebar3Version })
|
||||
core.setOutput('rebar3-version', rebar3Version)
|
||||
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/rebar3/bin`)
|
||||
core.endGroup()
|
||||
|
||||
installed = true
|
||||
@@ -593,7 +591,7 @@ alongside ${alternativeName}=${alternativeValue} \
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.join(
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
@@ -733,8 +731,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'erl'
|
||||
const args = ['-version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -750,8 +749,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'erl.exe'
|
||||
const args = ['+V']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -779,8 +779,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'elixir'
|
||||
const args = ['-v']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -819,8 +820,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'gleam'
|
||||
const args = ['--version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -852,8 +854,9 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'gleam.exe'
|
||||
const args = ['--version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -884,8 +887,12 @@ async function install(toolName, opts) {
|
||||
reportVersion: () => {
|
||||
const cmd = 'rebar3'
|
||||
const args = ['version']
|
||||
const env = {
|
||||
REBAR_GLOBAL_CONFIG_DIR: '/fake-dir',
|
||||
REBAR_CONFIG: 'fake.config',
|
||||
}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
win32: {
|
||||
@@ -903,23 +910,26 @@ 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: () => {
|
||||
const cmd = 'rebar3.cmd'
|
||||
const args = ['version']
|
||||
const env = {}
|
||||
|
||||
return [cmd, args]
|
||||
return [cmd, args, env]
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -952,19 +962,29 @@ async function installTool(opts) {
|
||||
core.debug(` ... it is, at ${cachePath}`)
|
||||
}
|
||||
|
||||
core.debug('Performing post extract operations...')
|
||||
await platformOpts.postExtract(cachePath)
|
||||
// This makes sure we run, e.g. in Windows, the installer in the runner
|
||||
// We're not caching the install, just the downloaded tool
|
||||
const runnerToolPath = path.join(
|
||||
process.env.RUNNER_TEMP,
|
||||
'.setup-beam',
|
||||
toolName,
|
||||
)
|
||||
fs.cpSync(cachePath, runnerToolPath, { recursive: true })
|
||||
|
||||
core.debug(`Adding ${cachePath}'s bin to system path`)
|
||||
core.addPath(path.join(cachePath, 'bin'))
|
||||
core.debug('Performing post extract operations...')
|
||||
await platformOpts.postExtract(runnerToolPath)
|
||||
|
||||
core.debug(`Adding ${runnerToolPath}' bin to system path`)
|
||||
const runnerToolPathBin = path.join(runnerToolPath, 'bin')
|
||||
core.addPath(runnerToolPathBin)
|
||||
|
||||
const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
|
||||
core.debug(`Exporting ${installDirForVarName} as ${cachePath}`)
|
||||
core.exportVariable(installDirForVarName, cachePath)
|
||||
core.debug(`Exporting ${installDirForVarName} as ${runnerToolPath}`)
|
||||
core.exportVariable(installDirForVarName, runnerToolPath)
|
||||
|
||||
core.info(`Installed ${installOpts.tool} version`)
|
||||
const [cmd, args] = platformOpts.reportVersion()
|
||||
await exec(cmd, args)
|
||||
const [cmd, args, env] = platformOpts.reportVersion()
|
||||
await exec(cmd, args, { env: { ...process.env, ...env } })
|
||||
}
|
||||
|
||||
function checkPlatform() {
|
||||
|
||||
+2
-2
@@ -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"
|
||||
|
||||
@@ -8,6 +8,8 @@ simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
|
||||
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const core = require('@actions/core')
|
||||
const setupBeam = require('../src/setup-beam')
|
||||
const { problemMatcher } = require('../matchers/elixir-matchers.json')
|
||||
@@ -535,6 +537,14 @@ rebar ${rebar3}`
|
||||
assert.strictEqual(appVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(appVersions.get('elixir'), elixir)
|
||||
|
||||
const absoluteFilename = path.join(os.tmpdir(), '.tool-versions')
|
||||
fs.writeFileSync(absoluteFilename, toolVersions)
|
||||
|
||||
process.env.GITHUB_WORKSPACE = process.cwd()
|
||||
const absoluteAppVersions = setupBeam.parseVersionFile(absoluteFilename)
|
||||
assert.strictEqual(absoluteAppVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(absoluteAppVersions.get('elixir'), elixir)
|
||||
|
||||
assert.ok(async () => {
|
||||
await setupBeam.install('otp', { toolVersion: erlang })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user