publish.sh: readable release titles (Stemify iOS <label>, Dev Build <n>)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 190b793043)
This commit is contained in:
root committed 2026-11-18 14:55:26 -08:00
1 parent 3a3a20107b
commit 40c72000aa
1 file changed
+5 -4
+5 -4
View File
@@ -10,11 +10,12 @@ API=https://git.iamchrisama.com/api/v1/repos/cdnutter/stemify
T=$(sed -n 's#.*://cdnutter:\([^@]*\)@.*#\1#p' ~/.config/gitea/cdnutter.credentials | head -1)
V=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml | tr 'A-Z' 'a-z' | sed -E 's/ (rc|beta) /-\1/; s/ /-/g')
BUILD=$(sed -nE 's/^ *CURRENT_PROJECT_VERSION: "(.*)"/\1/p' project.yml)
LABEL=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
die() { echo "$*" >&2; exit 1; }
case $MODE in
dev) WANT=dev; IPA=build/dev/$NAME-$V-dev.ipa; TAG=$TAGP$V-dev.$BUILD; PRE=true; UP=http://10.0.0.11:8093; Q='?source=dev' ;;
release) WANT=main; IPA=build/release/$NAME-$V.ipa; TAG=$TAGP$V; PRE=false; UP=http://10.0.0.11:8093; Q='?source=personal' ;;
dev) WANT=dev; IPA=build/dev/$NAME-$V-dev.ipa; TAG=$TAGP$V-dev.$BUILD; TITLE="Stemify iOS $LABEL (Dev Build $BUILD)"; PRE=true; UP=http://10.0.0.11:8093; Q='?source=dev' ;;
release) WANT=main; IPA=build/release/$NAME-$V.ipa; TAG=$TAGP$V; TITLE="Stemify iOS $LABEL"; PRE=false; UP=http://10.0.0.11:8093; Q='?source=personal' ;;
*) die "usage: $0 dev|release" ;;
esac
[ "$BRANCH" = "$WANT" ] || die "$MODE builds publish from $WANT (on $BRANCH)"
@@ -24,8 +25,8 @@ git diff --quiet HEAD || die "uncommitted changes"
|| die "$TAG already exists, bump CURRENT_PROJECT_VERSION (dev) or VERSION_LABEL (release)"
git push -q -u origin $BRANCH
BODY=${NOTES:-$(git log -1 --format=%s)}
ID=$(jq -n --arg t "$TAG" --arg c "$(git rev-parse HEAD)" --arg b "$BODY" --argjson p $PRE \
'{tag_name:$t, target_commitish:$c, name:$t, body:$b, prerelease:$p}' |
ID=$(jq -n --arg t "$TAG" --arg n "$TITLE" --arg c "$(git rev-parse HEAD)" --arg b "$BODY" --argjson p $PRE \
'{tag_name:$n, target_commitish:$c, name:$n, body:$b, prerelease:$p}' |
curl -fsS -H "Authorization: token $T" -H 'Content-Type: application/json' -d @- $API/releases | jq -r .id)
curl -fsS -o /dev/null -H "Authorization: token $T" -F "attachment=@$IPA" "$API/releases/$ID/assets?name=$(basename $IPA)"
curl -fsS -o /dev/null -X POST --data-binary @$IPA "$UP/api/upload/ipa$Q"