mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-08-08 00:53:15 +00:00
Fix Mac App Store publish hanging forever on build processing
The Mac App Store release job hung indefinitely on "Publish to App Store",
spinning until Actions' 6h default killed the (10x-billed) macOS runner:
Waiting for App Store Connect to finish processing the new build
(3.7.0 - 24) for MAC_OS
Root cause: the release lane ran upload_to_testflight with the build-processing
wait enabled. That wait lives in FastlaneCore::BuildWatcher, which polls each
build's processingState until it reads complete. For macOS builds the App Store
Connect API never reliably reports processingState as VALID, so it polls
forever even though the upload succeeded and the build is usable. iOS is
unaffected because its processingState does flip. deliver's select_build only
avoids the same hang when handed an explicit build number (direct lookup); a
nil/"latest" number routes it back into BuildWatcher.
- Fastfile (mac): skip_waiting_for_build_processing on the upload, and always
submit by an explicitly resolved build number so deliver takes the
direct-lookup path and never re-enters BuildWatcher. Widen the submit retry
budget for the release flow. iOS keeps its working wait-based flow.
- Workflows: add timeout-minutes: 120 to both App Store jobs as a hard cost
backstop, and a desktop_submit dispatch lane on the Mac workflow (mirrors
iOS) to submit an already-uploaded build without a rebuild.
- Add an Announce Release workflow plus a shared discord-release-message.sh
script, so a release's Discord message can be posted for a given tag when the
automated notify job was skipped (e.g. a cancelled run). notify now builds
its message from the same script, so the two can't drift.
47 lines
1.8 KiB
Bash
Executable file
47 lines
1.8 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Builds the Discord announcement `content` for a release and prints it to
|
|
# stdout. Shared by the automated notify job (publish-release.yml) and the
|
|
# manual announcer (announce-release.yml) so the token catalog, message format,
|
|
# and length handling live in exactly one place and can't drift apart.
|
|
#
|
|
# Required env:
|
|
# TAG - the release tag (may carry a +suffix for subset releases)
|
|
# RELEASE_NAME - release title
|
|
# RELEASE_URL - release html_url
|
|
# RELEASE_BODY - release body / changelog
|
|
set -euo pipefail
|
|
|
|
# Tokens → human display names for the Discord audience. Keep in sync with the
|
|
# Platform token catalog; this is the single source for release messaging.
|
|
to_display() {
|
|
case "$1" in
|
|
google-play) echo "Google Play" ;;
|
|
fdroid) echo "F-Droid" ;;
|
|
snap) echo "Snap" ;;
|
|
ms-store) echo "MS Store" ;;
|
|
mac-app-store) echo "Mac App Store" ;;
|
|
ios-app-store) echo "iOS App Store" ;;
|
|
server) echo "Server" ;;
|
|
*) echo "$1" ;;
|
|
esac
|
|
}
|
|
|
|
# Subset releases carry a +token(+token…) suffix; name them in a header line.
|
|
header=""
|
|
if [[ "${TAG:-}" == *+* ]]; then
|
|
pretty=""
|
|
for token in $(echo "${TAG#*+}" | tr '+' ' '); do
|
|
display="$(to_display "$token")"
|
|
if [ -z "$pretty" ]; then pretty="$display"; else pretty="$pretty, $display"; fi
|
|
done
|
|
header="🔧 Patch release — ${pretty} only"$'\n'
|
|
fi
|
|
|
|
content="$(printf '%s**New release:** %s\n**Download Here:** %s\n\n**Changelog:**\n%s' \
|
|
"$header" "${RELEASE_NAME:-}" "${RELEASE_URL:-}" "${RELEASE_BODY:-}")"
|
|
|
|
# Discord caps webhook content at 2000 characters. Trim by Unicode codepoint
|
|
# with jq (locale-independent, and never splits a multibyte character) rather
|
|
# than eating a 400 from the API.
|
|
printf '%s' "$content" | jq -Rrs 'if length > 2000 then .[0:1997] + "..." else . end'
|