Skip to content

Commit d162768

Browse files
committed
v1.3.8
1 parent 6303db7 commit d162768

File tree

5 files changed

+86
-91
lines changed

5 files changed

+86
-91
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@ on:
77
push:
88
pull_request:
99

10-
# env:
11-
# CARGO_TERM_COLOR: always
12-
1310
defaults:
1411
run:
1512
shell: bash --noprofile --norc -CeEuo pipefail {0}
1613

14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
1717
jobs:
1818
rust-test:
1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
os: [ubuntu-24.04, windows-latest, macos-14, macos-13]
2223
runs-on: ${{ matrix.os }}
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2524
steps:
2625
- uses: actions/checkout@v3
2726
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 23
2829
- uses: pnpm/action-setup@v4
2930
with:
3031
version: 10
@@ -61,11 +62,23 @@ jobs:
6162
uses: ./
6263
with:
6364
url: |-
64-
https://github.com/axodotdev/cargo-dist
65+
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/node.json
66+
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/bun.json
67+
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/boa.json
6568
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/llrt.json
69+
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/hermes.json
70+
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/xst.json
6671
https://github.com/ahaoboy/easy-install/raw/refs/heads/main/dist-manifest/fnm.json
72+
https://github.com/denoland/deno
73+
https://github.com/ahaoboy/txiki.js-build
74+
https://github.com/ahaoboy/spidermonkey-build
75+
https://github.com/ahaoboy/v8-build
76+
https://github.com/ahaoboy/jsc-build
77+
https://github.com/ahaoboy/jerryscript-build
78+
https://github.com/ahaoboy/mujs-build
79+
https://github.com/axodotdev/cargo-dist
6780
68-
- name: test setup
81+
- name: test
6982
run: |
7083
deno --version
7184
ei --version
@@ -75,9 +88,10 @@ jobs:
7588
qjs ./test.js
7689
mujs ./test.js
7790
78-
ls -lh ~/.easy-setup
91+
ls -lh ~/.easy-install
7992
8093
which llrt
8194
which fnm
8295
fnm --version
8396
llrt --version
97+
bun --version

bundle/action.js

Lines changed: 4 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easy-setup",
3-
"version": "1.3.5",
3+
"version": "1.3.9",
44
"description": "easy-setup",
55
"types": "dist/index.d.ts",
66
"main": "dist/index.js",
@@ -27,7 +27,7 @@
2727
"bundle": "esbuild --target=node20 --outdir=bundle --bundle --minify --platform=node --format=cjs src/action.ts"
2828
},
2929
"dependencies": {
30-
"@easy-install/easy-install": "1.3.1"
30+
"@easy-install/easy-install": "1.3.4"
3131
},
3232
"devDependencies": {
3333
"@actions/core": "1.11.1",

src/action.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { getMultilineInput } from '@actions/core'
2-
import { homedir } from 'os'
3-
import { join } from 'path'
1+
// FIXME: https://github.com/actions/toolkit/issues/1959
2+
// import { getMultilineInput } from '@actions/core'
3+
import { getMultilineInput } from './tool'
4+
45
import { addOutputToPath, install } from '@easy-install/easy-install'
56

67
const urlList = getMultilineInput('url')
@@ -18,7 +19,6 @@ async function main() {
1819
version,
1920
name,
2021
},
21-
join(homedir(), '.easy-setup'),
2222
).then(addOutputToPath)
2323
}
2424
}

src/tool.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Interface for getInput options
3+
*/
4+
export interface InputOptions {
5+
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
6+
required?: boolean
7+
8+
/** Optional. Whether leading/trailing whitespace will be trimmed for the input. Defaults to true */
9+
trimWhitespace?: boolean
10+
}
11+
/**
12+
* Gets the value of an input.
13+
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
14+
* Returns an empty string if the value is not defined.
15+
*
16+
* @param name name of the input to get
17+
* @param options optional. See InputOptions.
18+
* @returns string
19+
*/
20+
export function getInput(name: string, options?: InputOptions): string {
21+
const val: string =
22+
process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''
23+
if (options && options.required && !val) {
24+
throw new Error(`Input required and not supplied: ${name}`)
25+
}
26+
27+
if (options && options.trimWhitespace === false) {
28+
return val
29+
}
30+
31+
return val.trim()
32+
}
33+
/**
34+
* Gets the values of an multiline input. Each value is also trimmed.
35+
*
36+
* @param name name of the input to get
37+
* @param options optional. See InputOptions.
38+
* @returns string[]
39+
*/
40+
41+
export function getMultilineInput(
42+
name: string,
43+
options?: InputOptions,
44+
): string[] {
45+
const inputs: string[] = getInput(name, options)
46+
.split('\n')
47+
.filter((x) => x !== '')
48+
49+
if (options && options.trimWhitespace === false) {
50+
return inputs
51+
}
52+
53+
return inputs.map((input) => input.trim())
54+
}

0 commit comments

Comments
 (0)