mirror of
https://github.com/CompeyDev/setup-rokit.git
synced 2024-12-12 04:30:37 +00:00
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
name: setup-rokit
|
|
description: GitHub action to install and run rokit; a toolchain manager.
|
|
author: CompeyDev
|
|
|
|
inputs:
|
|
version:
|
|
description: "`rokit` git tag (usually in the form vx.x.x)"
|
|
required: false
|
|
path:
|
|
description: "Path to the directory with the toolchain manifest"
|
|
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: Install Rokit
|
|
run: |
|
|
case ${{ runner.os }} in
|
|
Linux|macOS) curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rojo-rbx/rokit/main/scripts/install.sh | bash -s - $(echo ${{ inputs.version }} | tr -d v) ;;
|
|
Windows) gh release download ${{ inputs.version }} --repo rojo-rbx/rokit --pattern *windows-x86_64.zip && unzip rokit-*.zip && ./rokit.exe self-install ;;
|
|
esac
|
|
env:
|
|
GITHUB_TOKEN: ${{ inputs.token }}
|
|
shell: bash
|
|
|
|
- name: Add Rokit to PATH
|
|
run: echo "$HOME/.rokit/bin" >> $GITHUB_PATH
|
|
shell: bash
|
|
|
|
- name: Create auth file
|
|
run: |
|
|
cat > $HOME/.rokit/auth.toml << EOF
|
|
github = "${{ inputs.token }}"
|
|
EOF
|
|
shell: bash
|
|
|
|
- name: Discover manifest file
|
|
id: manifest
|
|
run: |
|
|
manifest_path=$(find ${{ inputs.path }} -maxdepth 1 -name "rokit.toml" -o -name "aftman.toml" -o -name "foreman.toml")
|
|
echo "::debug::Discovered manifest path: $manifest_path"
|
|
echo "path=$manifest_path" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
|
|
- name: Cache binaries
|
|
if: ${{ inputs.cache == true || inputs.cache == 'true' }}
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.rokit/bin
|
|
~/.rokit/tool-storage
|
|
key: ${{ runner.os }}-rokit-${{hashFiles(steps.manifest.outputs.path)}}
|
|
|
|
- name: Install tools
|
|
run: |
|
|
cd ${{ inputs.path }}
|
|
rokit install --no-trust-check
|
|
shell: bash
|
|
|
|
branding:
|
|
icon: download
|
|
color: red
|