-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
55 lines (51 loc) · 1.97 KB
/
action.yml
File metadata and controls
55 lines (51 loc) · 1.97 KB
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
name: 'setup-rokit'
description: 'Install Rokit, the next-generation toolchain manager for Roblox projects.'
author: 'notthebestdev'
branding:
icon: 'package'
color: 'red'
inputs:
version:
description: 'Rokit version to install (use a tag name like v1.1.1, or "latest" for the newest release)'
required: false
default: 'latest'
runs:
using: 'composite'
steps:
- name: Detect platform
id: platform
shell: bash
run: |
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) platform=linux;;
Darwin*) platform=macos;;
CYGWIN*|MINGW*|MSYS*) platform=windows;;
*) platform="unknown"
esac
echo "platform=$platform" >> $GITHUB_OUTPUT
- name: Set up Rokit (Linux/macOS)
if: steps.platform.outputs.platform != 'windows'
shell: bash
run: |
version="${{ inputs.version }}"
if [ "$version" = "latest" ]; then
version=$(curl -s https://api.github.com/repos/rojo-rbx/rokit/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
fi
version="${version#v}"
echo "DEBUG: version being passed to install.sh is '$version'"
curl -sSf https://raw.githubusercontent.com/rojo-rbx/rokit/main/scripts/install.sh | bash -s "$version"
# the installer does not add rokit to path for some reason
echo "$PWD" >> "$GITHUB_PATH"
- name: Set up Rokit (Windows)
if: steps.platform.outputs.platform == 'windows'
shell: pwsh
run: |
$version = "${{ inputs.version }}"
if ($version -eq "latest") {
$release = Invoke-RestMethod "https://api.github.com/repos/rojo-rbx/rokit/releases/latest"
$version = $release.tag_name
}
Invoke-RestMethod "https://raw.githubusercontent.com/rojo-rbx/rokit/main/scripts/install.ps1" | Invoke-Expression
# again, it dosent install it to path
Add-Content -Path $env:GITHUB_PATH -Value "$pwd\rokit"