init: initial rokit support in action

This commit is contained in:
Erica Marigold 2024-07-15 19:17:19 +05:30 committed by GitHub
parent 6e0bdf7375
commit 6edd52f2cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,13 +1,13 @@
name: setup-aftman
description: GitHub action to install and run aftman; a toolchain manager.
name: setup-rokit
description: GitHub action to install and run rokit; a toolchain manager.
author: ok-nick
inputs:
version:
description: "`aftman` git tag (usually in the form vx.x.x)"
description: "`rokit` git tag (usually in the form vx.x.x)"
required: false
path:
description: "Path to the `aftman.toml` directory"
description: "Path to the directory with the toolchain manifest"
default: "."
required: false
cache:
@ -22,48 +22,15 @@ inputs:
runs:
using: "composite"
steps:
- name: Download aftman
run: |
case ${{ runner.os }} in
Linux) pattern="*linux-x86_64.zip" ;;
macOS) pattern="*macos-x86_64.zip" ;;
Windows) pattern="*windows-x86_64.zip" ;;
esac
gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern $pattern
- name: Install rokit
run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rojo-rbx/rokit/main/scripts/install.sh | sh
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
cat > $HOME/.rokit/auth.toml << EOF
github = "${{ inputs.token }}"
EOF
shell: bash
@ -73,16 +40,16 @@ runs:
uses: actions/cache@v4
with:
path: |
~/.aftman/bin
~/.aftman/tool-storage
key: ${{ runner.os }}-aftman-${{hashFiles(format('{0}/{1}', inputs.path, 'aftman.toml'))}}
~/.rokit/bin
~/.rokit/tool-storage
key: ${{ runner.os }}-rokit-${{hashFiles(format('{0}/{aftman,foreman,rokit}.toml', inputs.path))}}
- name: Install tools
run: |
cd ${{ inputs.path }}
aftman install --no-trust-check
rokit install --no-trust-check
shell: bash
branding:
icon: link-2
color: blue
icon: download
color: red