-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
103 lines (92 loc) · 3.01 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: 'uniget'
description: 'Install tools from the container ecosystem'
branding:
icon: 'package'
color: 'blue'
inputs:
version:
description: 'Version of uniget to use'
required: false
default: 'latest'
path:
description: 'Path to install uniget into'
required: false
default: '/usr/local/bin'
tools:
description: 'List of tools to install (space separated)'
required: false
prefix:
description: 'Directory prefix for tool installation'
required: false
default: ''
target:
description: 'Subdirectory relative to prefix for tool installation'
required: false
default: 'usr/local'
skip-conflicts:
description: 'Skip conflicting tools'
required: false
default: 'true'
plan:
description: 'Plan to install'
required: false
default: 'false'
log-level:
description: 'Log level'
required: false
default: 'info'
runs:
using: 'composite'
steps:
- name: Install uniget
shell: bash
run: |
echo "Installing uniget"
echo "Requested version ${{ inputs.version }}"
release_url="https://github.com/uniget-org/cli/releases/latest/download"
if test "${{ inputs.version }}" != "latest"; then
release_url="https://github.com/uniget-org/cli/releases/download/v${{ inputs.version }}"
fi
asset_name="uniget_Linux_$(uname -m).tar.gz"
echo "Creating target path ${{ inputs.path }}"
mkdir -p "${{ inputs.path }}"
echo "Using URL ${release_url}/${asset_name}"
curl --url "${release_url}/${asset_name}" \
--silent \
--location \
| tar --extract \
--gzip \
--directory ${{ inputs.path }} \
uniget
${{ inputs.path }}/uniget --version
- name: Update metadata
shell: bash
run: |
if test -z "${{inputs.tools }}"; then
echo "No tools requested. Metadata update skipped"
exit 0
fi
echo "Updating metadata"
${{ inputs.path }}/uniget --log-level=${{ inputs.log-level }} --prefix=${{ inputs.prefix }} --target=${{ inputs.target }} update
- name: Plan installation
shell: bash
run: |
if test -z "${{ inputs.tools }}"; then
echo "No tools requested"
exit 0
fi
if test "${{ inputs.plan }}" != "true"; then
echo "Not planning installation"
exit 0
fi
echo "Installing tools (${{ inputs.tools }})"
${{ inputs.path }}/uniget --log-level=${{ inputs.log-level }} --prefix=${{ inputs.prefix }} --target=${{ inputs.target }} install --skip-conflicts=${{ inputs.skip-conflicts }} ${{ inputs.tools }} --plan
- name: Install tools
shell: bash
run: |
if test -z "${{ inputs.tools }}"; then
echo "No tools requested"
exit 0
fi
echo "Installing tools (${{ inputs.tools }})"
${{ inputs.path }}/uniget --log-level=${{ inputs.log-level }} --prefix=${{ inputs.prefix }} --target=${{ inputs.target }} install --skip-conflicts=${{ inputs.skip-conflicts }} ${{ inputs.tools }}