Skip to content

chore: sync Mealie OpenAPI spec (v3.21.0) (#27) #3

chore: sync Mealie OpenAPI spec (v3.21.0) (#27)

chore: sync Mealie OpenAPI spec (v3.21.0) (#27) #3

name: Release on spec change
# Fires when a version bump lands on main (a spec-update PR, or a REVISION bump
# for MCP-only changes). Cuts a GitHub release; release creation lives here —
# not in update-spec — because main is protected and all changes arrive via PRs.
#
# Tag scheme: v<mealie-version>, plus -r<n> for MCP-only revisions on the same
# Mealie version (REVISION=1 is the base release and carries no suffix).
on:
push:
branches: [main]
paths:
- "MEALIE_VERSION" # new Mealie version
- "REVISION" # MCP-only change on the same Mealie version
workflow_dispatch: # manual re-release
permissions:
contents: write
concurrency:
group: release-on-spec
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2 # need the previous commit to diff the spec
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Cut release for this version
env:
GH_TOKEN: ${{ github.token }}
run: |
VER="$(cat MEALIE_VERSION)" # e.g. v3.20.1
REV="$(tr -dc '0-9' < REVISION 2>/dev/null || echo 1)"; REV="${REV:-1}"
TAG="$VER"; TITLE="Mealie ${VER}"
if [ "$REV" -gt 1 ]; then TAG="${VER}-r${REV}"; TITLE="Mealie ${VER} (build r${REV})"; fi
if gh release view "$TAG" >/dev/null 2>&1; then
echo "Release $TAG already exists — nothing to do."
exit 0
fi
git show HEAD~1:openapi.json > /tmp/old-spec.json 2>/dev/null || echo '{}' > /tmp/old-spec.json
python scripts/spec_diff.py /tmp/old-spec.json openapi.json > /tmp/notes.md
echo "----- release notes -----"; cat /tmp/notes.md
gh release create "$TAG" openapi.json \
--title "$TITLE" \
--notes-file /tmp/notes.md \
--latest