Skip to content

Commit b9cf21a

Browse files
authored
chore: manually downloads Earthly instead of using abandoned GHA (#169)
1 parent fe48d62 commit b9cf21a

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

actions/install-local/action.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@ runs:
1010
steps:
1111
- shell: bash
1212
run: echo "Building Forge CLI locally..."
13-
- name: Install Earthly
14-
uses: earthly/actions-setup@v1
13+
- name: Cache Earthly binary
14+
id: cache-earthly
15+
uses: actions/cache@v4
1516
with:
16-
version: latest
17+
path: /usr/local/bin/earthly
18+
key: ${{ runner.os }}
19+
- name: Install Earthly
20+
if: steps.cache-earthly.outputs.cache-hit == false
21+
shell: bash
22+
run: |
23+
wget -q https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
24+
chmod +x /usr/local/bin/earthly
25+
/usr/local/bin/earthly bootstrap
1726
- name: Login to Earthly Cloud
1827
if: steps.cache-binary.outputs.cache-hit == false
1928
shell: bash

actions/setup/action.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,25 @@ runs:
169169
fi
170170
171171
echo "version=$VERSION" >> $GITHUB_OUTPUT
172-
- name: Install Earthly
173-
uses: earthly/actions-setup@v1
172+
- name: Cache Earthly binary
173+
id: cache-binary
174+
uses: actions/cache@v4
174175
if: inputs.skip_earthly == 'false'
175176
with:
176-
version: ${{ steps.earthly.outputs.version }}
177+
path: /usr/local/bin/earthly
178+
key: ${{ runner.os }}-${{ steps.earthly.outputs.version }}
179+
- name: Install Earthly
180+
if: inputs.skip_earthly == 'false' && steps.cache-binary.outputs.cache-hit == false
181+
shell: bash
182+
run: |
183+
if [[ "${{ steps.earthly.outputs.version }}" == "latest" ]]; then
184+
wget -q https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
185+
else
186+
wget -q https://github.com/earthly/earthly/releases/download/v${{ steps.earthly.outputs.version}}/earthly-linux-amd64 -O /usr/local/bin/earthly
187+
fi
188+
189+
chmod +x /usr/local/bin/earthly
190+
/usr/local/bin/earthly bootstrap
177191
- name: Login to Earthly Cloud
178192
if: steps.earthly.outputs.token != '' && steps.earthly.conclusion == 'success'
179193
shell: bash

0 commit comments

Comments
 (0)