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