From d5ffec39a2062fbc8f59c8106c378f5561af2e98 Mon Sep 17 00:00:00 2001 From: "j.dev" Date: Tue, 11 Feb 2025 09:32:19 -0800 Subject: [PATCH] feat(asdf-tools): install asdf from release assets --- .github/workflows/asdf-tools.test.yml | 2 +- asdf-tools/action.yml | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/asdf-tools.test.yml b/.github/workflows/asdf-tools.test.yml index 9bcdfd6..3bc650c 100644 --- a/.github/workflows/asdf-tools.test.yml +++ b/.github/workflows/asdf-tools.test.yml @@ -5,7 +5,7 @@ on: - __noop jobs: - tests-pre-commit: + asdf-tools-test: runs-on: ubuntu-22.04 steps: - uses: hmarr/debug-action@v2 diff --git a/asdf-tools/action.yml b/asdf-tools/action.yml index 6c6970d..03d2043 100644 --- a/asdf-tools/action.yml +++ b/asdf-tools/action.yml @@ -1,8 +1,12 @@ name: Install asdf tools inputs: + version: + description: The version of asdf + default: v0.16.2 + required: false plugins: - description: List of additional plugins (e.g., =) + description: List of additional plugins (e.g., =, comma-separated) required: false context: description: Directory of the file .tool-versions located @@ -13,15 +17,22 @@ runs: using: composite steps: - name: Install asdf - # See https://github.com/asdf-vm/actions/commit/main/ - uses: asdf-vm/actions/setup@1bf052e01b498bba4f98e1bbb5c609bc212cf463 + run: | + set -e + curl -fsSL -o asdf.tar.gz "https://github.com/asdf-vm/asdf/releases/download/${{ inputs.version }}/asdf-${{ inputs.version }}-linux-amd64.tar.gz" + tar -xzf asdf.tar.gz + mv asdf /usr/local/bin/ + rm -f asdf.tar.gz + which asdf + echo "asdf installed successfully" + shell: bash - name: Cache tools # See https://github.com/actions/cache/commits/main/ uses: actions/cache@36f1e144e1c8edb0a652766b484448563d8baf46 with: path: /home/runner/.asdf - key: ${{ runner.os }}-^0.16.0-${{ hashFiles('**/.tool-versions') }} + key: ${{ runner.os }}-${{ inputs.version }}-${{ hashFiles('**/.tool-versions') }} - name: Install asdf tools run: |