Skip to content

Commit

Permalink
fix(actions): try to recover if just fails to install
Browse files Browse the repository at this point in the history
  • Loading branch information
ledif committed Jan 4, 2025
1 parent e1d20d4 commit 6f409ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/generate-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ jobs:

- name: Install Just
shell: bash
run: |
set -eoux pipefail
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
run: bash .github/workflows/shared/install-just.sh

- name: Check Just Syntax
shell: bash
run: |
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/reusable-build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ jobs:

- name: Install Just
shell: bash
run: |
set -eoux pipefail
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
run: bash .github/workflows/shared/install-just.sh

- name: Check Just Syntax
shell: bash
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ jobs:

- name: Install Just
shell: bash
run: |
set -eoux pipefail
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
run: bash .github/workflows/shared/install-just.sh

- name: Check Just Syntax
shell: bash
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/shared/install-just.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eoux pipefail
JUST_VERSION=$(curl --retry 3 --retry-all-errors -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
if [[ "${JUST_VERSION}" == "null" ]]; then
JUST_VERSION=1.38.0
fi
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz

Check warning on line 7 in .github/workflows/shared/install-just.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/shared/install-just.sh#L7

Double quote to prevent globbing and word splitting.
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just

Check warning on line 8 in .github/workflows/shared/install-just.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/shared/install-just.sh#L8

Double quote to prevent globbing and word splitting.
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz

Check warning on line 10 in .github/workflows/shared/install-just.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/shared/install-just.sh#L10

Double quote to prevent globbing and word splitting.

0 comments on commit 6f409ae

Please sign in to comment.