From 2975438949f95e42a6f5ccf14d92de1ed593ce15 Mon Sep 17 00:00:00 2001 From: Michel de Graaf Date: Tue, 8 Sep 2026 14:17:16 +0200 Subject: [PATCH 1/3] fix(ci): retry nightly tag updates --- .github/workflows/nightly.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 640706a..065e350 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -168,14 +168,33 @@ jobs: gh release edit nightly --draft --prerelease --latest=false fi - current_tag=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/nightly" --jq .object.sha 2>/dev/null || true) - if [ -n "$current_tag" ]; then - gh api --silent --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/tags/nightly" \ - -f sha="$SOURCE_SHA" -F force=true - else - gh api --silent --method POST "repos/$GITHUB_REPOSITORY/git/refs" \ - -f ref=refs/tags/nightly -f sha="$SOURCE_SHA" - fi + # The Git refs API can briefly lag a just-merged commit. Retry both + # the create and update paths, re-reading the ref each time so a + # successful-but-disconnected response is harmless and idempotent. + tag_ready=false + for attempt in 1 2 3 4 5; do + current_tag=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/nightly" --jq .object.sha 2>/dev/null || true) + if [ -n "$current_tag" ]; then + if gh api --silent --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/tags/nightly" \ + -f sha="$SOURCE_SHA" -F force=true; then + tag_ready=true + break + fi + elif gh api --silent --method POST "repos/$GITHUB_REPOSITORY/git/refs" \ + -f ref=refs/tags/nightly -f sha="$SOURCE_SHA"; then + tag_ready=true + break + fi + + [ "$attempt" -eq 5 ] || { + echo "::warning::Git refs API attempt $attempt failed; retrying" + sleep $((attempt * 2)) + } + done + [ "$tag_ready" = true ] || { + echo "::error::could not point the nightly tag at $SOURCE_SHA" + exit 1 + } if [ "$release_exists" = false ]; then gh release create nightly --verify-tag --draft --prerelease --latest=false \ From 922ad6fc35a7d8e0a42818f1fcf4adf6e387f802 Mon Sep 17 00:00:00 2001 From: Michel de Graaf Date: Tue, 8 Sep 2026 14:29:01 +0200 Subject: [PATCH 2/3] fix(ci): detect a missing nightly tag --- .github/workflows/nightly.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 065e350..005f468 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -168,13 +168,12 @@ jobs: gh release edit nightly --draft --prerelease --latest=false fi - # The Git refs API can briefly lag a just-merged commit. Retry both - # the create and update paths, re-reading the ref each time so a - # successful-but-disconnected response is harmless and idempotent. + # gh writes the REST error body to stdout on a missing ref, so use + # its exit status—not captured output—to choose create vs update. + # Retry both paths and re-read the ref to keep retries idempotent. tag_ready=false for attempt in 1 2 3 4 5; do - current_tag=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/nightly" --jq .object.sha 2>/dev/null || true) - if [ -n "$current_tag" ]; then + if gh api --silent "repos/$GITHUB_REPOSITORY/git/ref/tags/nightly" >/dev/null 2>&1; then if gh api --silent --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/tags/nightly" \ -f sha="$SOURCE_SHA" -F force=true; then tag_ready=true From a3105fb0606ecd88c9b3378b533776c21ab205ce Mon Sep 17 00:00:00 2001 From: Michel de Graaf Date: Tue, 8 Sep 2026 14:34:10 +0200 Subject: [PATCH 3/3] fix(docs): use deploy-independent nightly installer --- README.md | 2 +- website/public/install.sh | 4 ++-- website/src/lib/links.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 82893fa..3b7032c 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ To install the current successful build from `develop` instead, pass the installer's `--nightly` option through to `sh`: ```bash -curl -fsSL https://re-invention.nl/soulseek-rs/install.sh | sh -s -- --nightly +curl -fsSL https://raw.githubusercontent.com/michel/soulseek-rs/develop/website/public/install.sh | sh -s -- --nightly ``` Nightly is a mutable prerelease rebuilt every day and whenever the **Nightly** diff --git a/website/public/install.sh b/website/public/install.sh index 15326f0..165d778 100644 --- a/website/public/install.sh +++ b/website/public/install.sh @@ -5,7 +5,7 @@ # curl -fsSL https://re-invention.nl/soulseek-rs/install.sh | sh # # Latest successful build from develop: -# curl -fsSL https://re-invention.nl/soulseek-rs/install.sh | sh -s -- --nightly +# curl -fsSL https://raw.githubusercontent.com/michel/soulseek-rs/develop/website/public/install.sh | sh -s -- --nightly # # Stable installs use Homebrew when it is on PATH (macOS and Linux). Nightly # installs always download the prebuilt binary for this platform. Direct @@ -30,7 +30,7 @@ Install the latest stable soulseek-rs release. Options: -h, --help Show this help. When piping the script, pass the option after `sh -s --`: - curl -fsSL https://re-invention.nl/soulseek-rs/install.sh | sh -s -- --nightly + curl -fsSL https://raw.githubusercontent.com/michel/soulseek-rs/develop/website/public/install.sh | sh -s -- --nightly SOULSEEK_RS_INSTALL_DIR overrides the destination directory. EOF diff --git a/website/src/lib/links.ts b/website/src/lib/links.ts index ff75651..fdb4f37 100644 --- a/website/src/lib/links.ts +++ b/website/src/lib/links.ts @@ -27,4 +27,5 @@ export const SITE_URL = 'https://re-invention.nl/soulseek-rs/' export const INSTALL_CMD = `curl -fsSL ${SITE_URL}install.sh | sh` -export const NIGHTLY_INSTALL_CMD = `${INSTALL_CMD} -s -- --nightly` +export const NIGHTLY_INSTALL_CMD = + 'curl -fsSL https://raw.githubusercontent.com/michel/soulseek-rs/develop/website/public/install.sh | sh -s -- --nightly'