-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
64 lines (59 loc) · 1.8 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Setup JBang
description: 'Set up a specific version of JBang and add it to the PATH'
branding:
icon: 'terminal'
color: 'blue'
inputs:
version:
description: 'The version of JBang to download'
default: 'latest'
required: true
setup-java:
default: 'true'
description: 'Setup internal Java runtime.'
required: false
runs:
using: 'composite'
steps:
- name: 'Download JBang'
shell: bash
if: runner.os != 'Windows'
env:
VERSION_INPUT: ${{ inputs.version }}
run: |
echo "::group::⬇️ Download JBang"
if [[ "$VERSION_INPUT" != "latest" ]]; then
export JBANG_DOWNLOAD_VERSION=$VERSION_INPUT
fi
curl -Ls https://sh.jbang.dev | bash -s - app setup
echo "${HOME}/.jbang/bin" >> $GITHUB_PATH
${HOME}/.jbang/bin/jbang version
echo "::endgroup::"
- name: 'Setup JBang'
shell: bash
if: runner.os != 'Windows'
run: |
echo "::group::🔧 Setup JBang"
echo "${HOME}/.jbang/bin" >> $GITHUB_PATH
${HOME}/.jbang/bin/jbang version
echo "::endgroup::"
- name: 'Download JBang (Windows)'
shell: pwsh
if: runner.os == 'Windows'
env:
VERSION_INPUT: ${{ inputs.version }}
run: |
echo "::group::⬇️ Download JBang"
if ($env:VERSION_INPUT -ne "latest") {
$env:JBANG_DOWNLOAD_VERSION = $env:VERSION_INPUT
}
iex "& { $(iwr https://ps.jbang.dev) } app setup"
echo "::endgroup::"
- name: 'Setup JBang (Windows)'
shell: pwsh
if: runner.os == 'Windows'
run: |
echo "::group::🔧 Setup JBang"
echo "$HOME\.jbang\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& $HOME\.jbang\bin\jbang.ps1 version
echo "::endgroup::"