From 6edd52f2cd128fc91f3dcce074c498875b1ac708 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Mon, 15 Jul 2024 19:17:19 +0530 Subject: [PATCH] init: initial rokit support in action --- action.yml | 59 ++++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 46 deletions(-) diff --git a/action.yml b/action.yml index 8f2c12b..b855a95 100644 --- a/action.yml +++ b/action.yml @@ -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