Josh, 4 Oct 2026: 0.3.1, 0.3.2 and 0.3.3 each took eight hand steps and an hour. The tool runs them in order, each step idempotent and resumable (--from): preflight, bump (six version files, one function, read back), push-inputs, commit and push, the windows.yml run polled with gh (auth switch before every call), fetch, DMG under the build lock, copy, signed manifest, one deploy, HEAD/GET verification with sizes and sha256, one console item. --dry-run prints the plan, --check compares the version files, --self-test bumps a scratch copy. Secrets never printed. Found by --check: Igneum-Miner.iss and Info.plist were left at 0.3.2 when 0.3.3 was cut (CI passed -Version from Cargo.toml, so the installer was right; the Mac bundle said 0.3.2 because build-dmg.sh's sed only matched 0.3.0). Both aligned to 0.3.3; build-dmg.sh now stamps the version with plutil. fetch-ci-artifacts.sh: CONSOLE_SKIP=1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
64 lines
4.4 KiB
Bash
Executable file
64 lines
4.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Pulls the Windows installer and payload from the latest green run of .github/workflows/windows.yml on master and
|
|
# copies them into the downloads folder (dl/<token>/), where the other packages live. Run on the Mac:
|
|
#
|
|
# packaging/windows/fetch-ci-artifacts.sh [--deploy] [run-id]
|
|
#
|
|
# Without --deploy it prints the deploy command for the main session to run; with --deploy it deploys the folder with
|
|
# the Vercel CLI itself. A run id (gh run list) picks a specific run instead of the latest green one.
|
|
# The installer also goes into the over-the-air update manifest (packaging/ota/publish-manifest.sh, Windows entry;
|
|
# OTA_NOTES= for the changelog line, OTA_SKIP=1 to leave the manifest alone), so the deploy ships both.
|
|
# Reads ~/.config/igneum/dl-token, ~/.config/igneum/dlsite-dir (IGNEUM_DLSITE overrides) and the gh login, which must
|
|
# be igneum-josh (gh auth switch --user igneum-josh).
|
|
set -euo pipefail
|
|
REPO="igneum-network/igneum"
|
|
DEPLOY=0
|
|
RUN_ID=""
|
|
for a in "$@"; do
|
|
case "$a" in --deploy) DEPLOY=1 ;; *) RUN_ID="$a" ;; esac
|
|
done
|
|
TOKEN_FILE="$HOME/.config/igneum/dl-token"
|
|
DLSITE="${IGNEUM_DLSITE:-}"
|
|
[ -n "$DLSITE" ] || { [ -f "$HOME/.config/igneum/dlsite-dir" ] && DLSITE="$(tr -d '[:space:]' < "$HOME/.config/igneum/dlsite-dir")"; } || true
|
|
[ -f "$TOKEN_FILE" ] || { echo "no $TOKEN_FILE" >&2; exit 1; }
|
|
TOKEN="$(tr -d '[:space:]' < "$TOKEN_FILE")"
|
|
DEST="$DLSITE/dl/$TOKEN"
|
|
[ -n "$DLSITE" ] && [ -d "$DEST" ] || { echo "no downloads folder: set IGNEUM_DLSITE or ~/.config/igneum/dlsite-dir (must hold dl/<token>/)" >&2; exit 1; }
|
|
gh auth status 2>&1 | grep -q 'Active account: true' || { echo "gh is not logged in" >&2; exit 1; }
|
|
gh auth status 2>&1 | grep -B1 'Active account: true' | grep -q 'igneum-josh' || { echo "gh active account is not igneum-josh: run gh auth switch --user igneum-josh" >&2; exit 1; }
|
|
|
|
if [ -z "$RUN_ID" ]; then
|
|
RUN_ID="$(gh run list --repo "$REPO" --workflow windows.yml --branch master --status success --limit 1 --json databaseId --jq '.[0].databaseId')"
|
|
[ -n "$RUN_ID" ] && [ "$RUN_ID" != "null" ] || { echo "no green windows.yml run on master yet" >&2; exit 1; }
|
|
fi
|
|
gh run view "$RUN_ID" --repo "$REPO" --json headSha,displayTitle,updatedAt,url,conclusion --jq '"run \(.url)\n\(.displayTitle)\n\(.headSha[0:12]) \(.updatedAt) \(.conclusion)"'
|
|
|
|
TMP="$(mktemp -d)"
|
|
gh run download "$RUN_ID" --repo "$REPO" --name igneum-windows-installer --name igneum-windows-payload --dir "$TMP"
|
|
SETUP="$(find "$TMP" -name 'Igneum-Miner-Setup-*.exe' | head -1)"
|
|
PAYLOAD="$(find "$TMP" -name 'igneum-windows-app.zip' | head -1)"
|
|
[ -n "$SETUP" ] && [ -n "$PAYLOAD" ] || { echo "the run has no installer or payload artifact" >&2; ls -R "$TMP"; exit 1; }
|
|
cp "$SETUP" "$DEST/"
|
|
cp "$PAYLOAD" "$DEST/igneum-windows-app.zip"
|
|
cat > "$DEST/igneum-windows-ci.json" <<JSON
|
|
{ "run": "https://github.com/$REPO/actions/runs/$RUN_ID", "installer": "$(basename "$SETUP")", "payload": "igneum-windows-app.zip", "fetched_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)" }
|
|
JSON
|
|
rm -rf "$TMP"
|
|
echo "copied into $DEST:"
|
|
ls -la "$DEST/$(basename "$SETUP")" "$DEST/igneum-windows-app.zip"
|
|
# the console's Builds tab (relay/): one build event per fetched CI run; never fatal. CONSOLE_SKIP=1 leaves it to the
|
|
# caller (tools/ship-app.mjs posts one item for the whole cut).
|
|
[ "${CONSOLE_SKIP:-0}" = 1 ] || node "$(dirname "$0")/../../tools/console.mjs" post --kind build --title "Windows CI $(basename "$SETUP") fetched (run $RUN_ID)" --body "https://github.com/$REPO/actions/runs/$RUN_ID" >/dev/null 2>&1 || true
|
|
# the over-the-air manifest (packaging/ota): the Windows entry for this installer; the Mac entry of the same version is
|
|
# carried over. OTA_NOTES= sets the changelog line; OTA_SKIP=1 leaves the manifest alone.
|
|
if [ "${OTA_SKIP:-0}" != 1 ]; then
|
|
SETUP_VERSION="$(basename "$SETUP" | sed -n 's/^Igneum-Miner-Setup-\(.*\)\.exe$/\1/p')"
|
|
"$(dirname "$0")/../ota/publish-manifest.sh" --version "$SETUP_VERSION" --win "$DEST/$(basename "$SETUP")" --notes "${OTA_NOTES:-Windows build $SETUP_VERSION from CI run $RUN_ID}" --no-deploy
|
|
fi
|
|
if [ "$DEPLOY" = 1 ]; then
|
|
(cd "$DLSITE" && npx vercel@latest --global-config "$HOME/.config/igneum/vercel" deploy --prod --yes 2>&1 | grep -v "$TOKEN" || true)
|
|
echo "live: https://dl.igneum.network/dl/<token>/$(basename "$SETUP")"
|
|
node "$(dirname "$0")/../../tools/console.mjs" sync-dl >/dev/null 2>&1 || true
|
|
else
|
|
echo "deploy: cd $DLSITE && npx vercel@latest --global-config ~/.config/igneum/vercel deploy --prod --yes"
|
|
fi
|