-
Notifications
You must be signed in to change notification settings - Fork 8
/
action.yml
93 lines (81 loc) · 2.34 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
name: setup-aftman
description: GitHub action to install and run aftman; a toolchain manager.
author: ok-nick
inputs:
version:
description: "`aftman` git tag (usually in the form vx.x.x)"
required: false
path:
description: "Path to the `aftman.toml` directory"
default: "."
required: false
cache:
description: "Whether to enable caching"
default: "false"
required: false
token:
description: "GitHub token via `github.token`"
default: "${{ github.token }}"
required: false
runs:
using: "composite"
steps:
- name: Download aftman
run: |
case ${{ runner.arch }} in
"X86" | "X64") fileArch="x86_64" ;;
"ARM" | "ARM64") fileArch="aarch64" ;;
esac
case ${{ runner.os }} in
Linux) pattern="*linux-$fileArch.zip" ;;
macOS) pattern="*macos-$fileArch.zip" ;;
Windows) pattern="*windows-$fileArch.zip" ;;
esac
gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern $pattern
env:
GITHUB_TOKEN: ${{ inputs.token }}
shell: bash
- name: Install aftman
run: |
unzip aftman*.zip
./aftman self-install
shell: bash
- name: Delete artifacts
run: |
rm aftman*.zip
if ${{ runner.os == 'Windows' }}; then
rm aftman.exe
else
rm aftman
fi
shell: bash
- name: Set environment variable
if: runner.os == 'Windows'
run: echo "$HOME/.aftman/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell
- name: Set environment variable
if: runner.os != 'Windows'
run: echo "$HOME/.aftman/bin" >> $GITHUB_PATH
shell: bash
- name: Create auth file
run: |
cat > $HOME/.aftman/auth.toml << EOF
github = "${{ inputs.token }}"
EOF
shell: bash
- name: Cache binaries
if: ${{ inputs.cache == true || inputs.cache == 'true' }}
uses: actions/cache@v4
with:
path: |
~/.aftman/bin
~/.aftman/tool-storage
key: ${{ runner.os }}-aftman-${{hashFiles(format('{0}/{1}', inputs.path, 'aftman.toml'))}}
- name: Install tools
run: |
cd ${{ inputs.path }}
aftman install --no-trust-check
shell: bash
branding:
icon: link-2
color: blue