2022-07-18 04:41:58 +01:00
|
|
|
name: setup-aftman
|
2022-07-18 18:32:35 +01:00
|
|
|
description: Github action to install and run aftman; a toolchain manager.
|
2022-07-18 04:41:58 +01:00
|
|
|
author: ok-nick
|
2022-07-18 02:32:18 +01:00
|
|
|
|
|
|
|
inputs:
|
|
|
|
version:
|
2022-09-17 04:16:42 +01:00
|
|
|
description: "`aftman` version in the form `vx.x.x`"
|
2022-07-18 02:32:18 +01:00
|
|
|
required: false
|
2022-08-18 20:49:59 +01:00
|
|
|
trust-check:
|
2022-09-17 04:16:42 +01:00
|
|
|
description: "Whether to check trusts"
|
|
|
|
deprecationMessage: "Input `trust-check` is no longer used in `setup-aftman`, consider removing it from your configuration"
|
|
|
|
default: "true"
|
2022-08-18 20:49:59 +01:00
|
|
|
required: false
|
|
|
|
trusts:
|
2022-09-17 04:16:42 +01:00
|
|
|
description: "List of trusted tools separated by spaces"
|
|
|
|
deprecationMessage: "Input `trusts` is no longer used in `setup-aftman`, consider removing it from your configuration"
|
2022-08-18 20:49:59 +01:00
|
|
|
required: false
|
2022-07-18 03:56:05 +01:00
|
|
|
path:
|
2022-09-17 04:16:42 +01:00
|
|
|
description: "Path to the `aftman.toml` directory"
|
|
|
|
default: "."
|
2022-07-18 03:56:05 +01:00
|
|
|
required: false
|
2022-07-18 02:32:18 +01:00
|
|
|
token:
|
2022-09-17 04:16:42 +01:00
|
|
|
description: "Github token from `github.token`"
|
|
|
|
default: "${{ github.token }}"
|
2022-07-18 17:07:51 +01:00
|
|
|
required: false
|
|
|
|
|
2022-07-18 02:32:18 +01:00
|
|
|
runs:
|
2022-09-17 04:16:42 +01:00
|
|
|
using: "composite"
|
2022-07-18 02:32:18 +01:00
|
|
|
steps:
|
|
|
|
- name: Download aftman
|
2022-08-22 19:26:06 +01:00
|
|
|
run: |
|
2022-08-22 20:06:49 +01:00
|
|
|
case ${{ runner.os }} in
|
2022-08-22 19:26:06 +01:00
|
|
|
Linux) pattern="*linux-x86_64.zip" ;;
|
|
|
|
macOS) pattern="*macos-x86_64.zip" ;;
|
|
|
|
Windows) pattern="*windows-x86_64.zip" ;;
|
|
|
|
esac
|
2022-07-18 02:32:18 +01:00
|
|
|
|
2022-08-22 19:26:06 +01:00
|
|
|
gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern $pattern
|
2022-07-18 17:20:56 +01:00
|
|
|
shell: bash
|
2022-07-18 04:55:01 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ inputs.token }}
|
2022-07-18 02:32:18 +01:00
|
|
|
|
|
|
|
- name: Install aftman
|
|
|
|
run: |
|
|
|
|
unzip aftman*.zip
|
|
|
|
./aftman self-install
|
2022-09-17 04:46:24 +01:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Delete artifacts
|
|
|
|
run: |
|
2022-09-17 04:35:45 +01:00
|
|
|
rm aftman*.zip
|
2022-09-24 05:49:27 +01:00
|
|
|
if ${{ runner.os == 'Windows' }}; then
|
|
|
|
rm aftman.exe
|
|
|
|
else
|
|
|
|
rm aftman
|
|
|
|
fi
|
2022-08-22 22:01:06 +01:00
|
|
|
shell: bash
|
2022-09-17 04:16:42 +01:00
|
|
|
|
2022-08-22 22:01:06 +01:00
|
|
|
- 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
|
2022-07-18 17:20:56 +01:00
|
|
|
shell: bash
|
2022-07-18 02:32:18 +01:00
|
|
|
|
2022-09-17 04:17:01 +01:00
|
|
|
- name: Create auth file
|
|
|
|
run: |
|
2022-09-17 04:45:46 +01:00
|
|
|
cat > $HOME/.aftman/auth.toml << EOF
|
2022-09-22 18:22:45 +01:00
|
|
|
github = "${{ inputs.token }}"
|
2022-09-17 04:17:01 +01:00
|
|
|
EOF
|
|
|
|
shell: bash
|
|
|
|
|
2022-07-18 03:56:05 +01:00
|
|
|
- name: Install tools
|
|
|
|
run: |
|
|
|
|
cd ${{ inputs.path }}
|
2022-08-22 20:06:49 +01:00
|
|
|
aftman install --no-trust-check
|
2022-07-18 17:20:56 +01:00
|
|
|
shell: bash
|
2022-07-18 03:56:05 +01:00
|
|
|
|
2022-07-18 02:32:18 +01:00
|
|
|
branding:
|
|
|
|
icon: link-2
|
|
|
|
color: blue
|