File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,15 +47,22 @@ jobs:
4747 run : |
4848 tag="${GITHUB_REF#refs/tags/}"
4949 prerelease_flag=""
50+ latest_flag=""
5051 if [[ "$tag" == *beta* ]]; then
5152 prerelease_flag="--prerelease"
5253 else
53- # Stable releases must originate from main
54- branch=$(git branch -r --contains "$GITHUB_SHA" | grep -E '^\s*origin/main$' || true)
54+ # Stable releases must originate from main or the 1.12-compat
55+ # maintenance branch (older Obsidian versions).
56+ branch=$(git branch -r --contains "$GITHUB_SHA" | grep -E '^\s*origin/(main|1\.12-compat)$' || true)
5557 if [[ -z "$branch" ]]; then
56- echo "ERROR: Stable tag '$tag' was not pushed from main. Aborting."
58+ echo "ERROR: Stable tag '$tag' was not pushed from main or 1.12-compat . Aborting."
5759 exit 1
5860 fi
61+ # Releases from 1.12-compat target older Obsidian users only —
62+ # don't let them supersede main's release as "Latest".
63+ if echo "$branch" | grep -qE 'origin/1\.12-compat$'; then
64+ latest_flag="--latest=false"
65+ fi
5966 fi
6067
6168 if [[ -z "$prerelease_flag" ]]; then
6572 gh release create "$tag" \
6673 --title="$tag" \
6774 $prerelease_flag \
75+ $latest_flag \
6876 main.js manifest.json manifest-beta.json styles.css
You can’t perform that action at this time.
0 commit comments