diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..987e4c1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: release-ebook + +# Publishes the cookbook as a GitHub Release with BlimaCake.epub attached. +# Runs when a tag like `cookbook-2026-07` is pushed, or manually from the +# Actions tab (supply the tag). The EPUB is rebuilt from the Markdown here so +# the released file always matches the current recipes, even if the committed +# copy at the repo root was not refreshed. + +on: + push: + tags: + - "cookbook-*" + workflow_dispatch: + inputs: + tag: + description: "Release tag to create (for example cookbook-2026-07)" + required: true + +permissions: + contents: write + +jobs: + release: + name: Publish cookbook release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + run: pip install -r tools/requirements.txt + - name: Rebuild the EPUB from the Markdown + run: python tools/build_epub.py --out BlimaCake.epub + - name: Determine release tag + id: tag + run: echo "name=${{ github.event.inputs.tag || github.ref_name }}" >> "$GITHUB_OUTPUT" + - name: Publish release with the EPUB attached + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.tag.outputs.name }} + name: "BlimaCake cookbook (${{ steps.tag.outputs.name }})" + body: | + The Blima Cake recipe archive as a downloadable EPUB e-book. + + Open BlimaCake.epub on Apple Books, Kindle, Kobo, Google Play Books, + and other readers. See docs/read-the-cookbook.md for step-by-step + instructions for each platform. + files: BlimaCake.epub + fail_on_unmatched_files: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 9327f64..2c886f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,17 @@ Recipe imports are logged both here (summary) and in ### Added +- **Automated e-book release workflow + ([`.github/workflows/release.yml`](.github/workflows/release.yml)).** Publishing + the cookbook as a GitHub Release is now a one-step action: push a tag named + `cookbook-*` (for example `cookbook-2026-07`), or run the **release-ebook** workflow + from the Actions tab and supply the tag. The workflow rebuilds `BlimaCake.epub` from + the current Markdown (deterministic build; PyYAML + Pillow) and attaches it to the + release, so the released file always matches the recipes. It uses a scoped + `contents: write` permission and does not touch the existing validation gates. The + maintainer note in [`docs/about-this-archive.md`](docs/about-this-archive.md) was + updated to describe it. + - **Static-site phase proposal ([ADR 0003](docs/adr/0003-static-site-phase.md)).** A scoped, owner-facing proposal to present the archive as a friendly recipe-blog website generated from the same Markdown and hosted on GitHub Pages: goal, options diff --git a/docs/about-this-archive.md b/docs/about-this-archive.md index b465d8d..dae3db7 100644 --- a/docs/about-this-archive.md +++ b/docs/about-this-archive.md @@ -76,11 +76,14 @@ no other tools required), so it can be rebuilt at any time and always matches th recipes here. See [Read the cookbook](read-the-cookbook.md) for how to open it. The file is committed at the repository root, so the download link in the README -always points at the current build. For a tidy versioned copy, the owner can also -attach `BlimaCake.epub` to a **GitHub Release**: on GitHub, open **Releases** then -**Draft a new release**, choose a tag (for example `cookbook-2026-07`), give it a -title, drag `BlimaCake.epub` into the assets box, and publish. The release page then -carries a permanent, versioned download link that can be shared on its own. +always points at the current build. For a tidy versioned copy, the archive also +publishes `BlimaCake.epub` as a **GitHub Release**. This is automated by +[`.github/workflows/release.yml`](../.github/workflows/release.yml): push a tag named +`cookbook-` (for example `cookbook-2026-07`), or run the **release-ebook** +workflow from the Actions tab and supply the tag. The workflow rebuilds the EPUB from +the current Markdown and attaches it to the release, so the released file always +matches the recipes. The release page then carries a permanent, versioned download +link that can be shared on its own. ## Rights