Merge pull request #93 from michel/nightly
fix(nightly): harden publishing and the live install command
This commit is contained in:
@@ -168,14 +168,32 @@ jobs:
|
|||||||
gh release edit nightly --draft --prerelease --latest=false
|
gh release edit nightly --draft --prerelease --latest=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
current_tag=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/nightly" --jq .object.sha 2>/dev/null || true)
|
# gh writes the REST error body to stdout on a missing ref, so use
|
||||||
if [ -n "$current_tag" ]; then
|
# its exit status—not captured output—to choose create vs update.
|
||||||
gh api --silent --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/tags/nightly" \
|
# Retry both paths and re-read the ref to keep retries idempotent.
|
||||||
-f sha="$SOURCE_SHA" -F force=true
|
tag_ready=false
|
||||||
else
|
for attempt in 1 2 3 4 5; do
|
||||||
gh api --silent --method POST "repos/$GITHUB_REPOSITORY/git/refs" \
|
if gh api --silent "repos/$GITHUB_REPOSITORY/git/ref/tags/nightly" >/dev/null 2>&1; then
|
||||||
-f ref=refs/tags/nightly -f sha="$SOURCE_SHA"
|
if gh api --silent --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/tags/nightly" \
|
||||||
fi
|
-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
|
if [ "$release_exists" = false ]; then
|
||||||
gh release create nightly --verify-tag --draft --prerelease --latest=false \
|
gh release create nightly --verify-tag --draft --prerelease --latest=false \
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ To install the current successful build from `develop` instead, pass the
|
|||||||
installer's `--nightly` option through to `sh`:
|
installer's `--nightly` option through to `sh`:
|
||||||
|
|
||||||
```bash
|
```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**
|
Nightly is a mutable prerelease rebuilt every day and whenever the **Nightly**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# curl -fsSL https://re-invention.nl/soulseek-rs/install.sh | sh
|
# curl -fsSL https://re-invention.nl/soulseek-rs/install.sh | sh
|
||||||
#
|
#
|
||||||
# Latest successful build from develop:
|
# 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
|
# Stable installs use Homebrew when it is on PATH (macOS and Linux). Nightly
|
||||||
# installs always download the prebuilt binary for this platform. Direct
|
# 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.
|
-h, --help Show this help.
|
||||||
|
|
||||||
When piping the script, pass the option after `sh -s --`:
|
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.
|
SOULSEEK_RS_INSTALL_DIR overrides the destination directory.
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -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 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'
|
||||||
|
|||||||
Reference in New Issue
Block a user