Skip to content

Commit

Permalink
fix(actions): try to recover if just fails to install (#81)
Browse files Browse the repository at this point in the history
* fix(actions): try to recover if just fails to install

* use loop if JUST_VERSION is garbage

* quoting vars to appease the lint gods

---------

Co-authored-by: m2 <[email protected]>
  • Loading branch information
ledif and m2Giles authored Jan 6, 2025
1 parent ac00f87 commit c7e6976
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
while [[ "${JUST_VERSION:-}" =~ null || -z "${JUST_VERSION:-}" ]]
do
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
done
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

0 comments on commit c7e6976

Please sign in to comment.