Skip to content

Commit 7a3df51

Browse files
committed
feat: adds install action
1 parent 59003c7 commit 7a3df51

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/workflows/test.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Test
2+
on:
3+
push:
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Install Forge CLI
11+
uses: ./forge/actions/install
12+
with:
13+
local: "true"

forge/actions/install/action.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Install Forge CLI
2+
description: Installs the Catalyst Forge CLI on the local runner
3+
inputs:
4+
earthly_version:
5+
description: The version of Earthly to install if not present
6+
default: "latest"
7+
local:
8+
description: If true, the CLI will be installed by building it locally with Earthly (only used for testing)
9+
default: "false"
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Check if earthly is installed
14+
id: check
15+
shell: bash
16+
run: |
17+
if ! command -v earthly &> /dev/null; then
18+
echo "found=false" >> $GITHUB_ENV
19+
else
20+
echo "found=true" >> $GITHUB_ENV
21+
- name: Install Earthly
22+
uses: earthly/actions-setup@v1
23+
if: steps.check.outputs.env.found == 'false'
24+
with:
25+
version: ${{ inputs.earthly_version }}
26+
- name: Build Forge CLI
27+
shell: bash
28+
run: |
29+
earthly --artifact +build/forge /usr/local/bin/forge

forge/actions/setup/action.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)