Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# An idle release-plz is indistinguishable from a healthy one: it exits 0
# and prints {"prs":[]}. That is how this repo went from v0.3.0 to v0.3.1
# with no release PR ever opened, across a month of green runs. If there
# are feat/fix/breaking commits since the last tag and release-plz
# proposed nothing, say so out loud.
- name: Flag a silent no-op
if: steps.release-plz.outputs.prs_created != 'true' && steps.release-plz.outputs.releases_created != 'true'
run: |
set -uo pipefail
LAST_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)"
[[ -n "$LAST_TAG" ]] || exit 0
BUMPING="$(git log --format=%s "${LAST_TAG}..HEAD" |
grep -cE '^(feat|fix)(\([^)]*\))?!?:|^[a-z]+(\([^)]*\))?!:' || true)"
if [[ "${BUMPING:-0}" -gt 0 ]]; then
echo "::warning::release-plz proposed no release PR, but ${BUMPING} version-bumping commit(s) landed since ${LAST_TAG}. It may be skipping this package — check release-plz.toml (git_only) and Cargo.toml (publish)."
else
echo "release-plz proposed nothing; no version-bumping commits since ${LAST_TAG}. Expected."
fi

# GITHUB_TOKEN-pushed tags never trigger workflows, so start the binary
# build ourselves for each release this run just tagged.
- name: Dispatch release build
Expand Down
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ readme = "README.md"
keywords = ["dictation", "speech-to-text", "elevenlabs", "voice", "accessibility"]
categories = ["command-line-utilities", "multimedia::audio"]
# Not on crates.io — an unrelated "dit" crate (0.0.1, 2022) squats the name
# there. This also stops release-plz from versioning against that foreign
# crate; with no registry, it derives the last release from our git tags.
# there, so this is purely a guard against an accidental `cargo publish`.
#
# It is NOT what keeps release-plz off that foreign crate — believing so cost us
# every release PR between v0.3.0 and v0.3.1. release-plz skips private packages
# outright, so this line alone makes it go silently, greenly idle. `git_only`
# in release-plz.toml is what pins versioning to our git tags *and* re-admits a
# private package; read the comment there before touching either line.
publish = false

[[bin]]
Expand Down
23 changes: 21 additions & 2 deletions release-plz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,27 @@
# binaries and publishes the GitHub Release.

[workspace]
# We don't publish to crates.io.
publish = false
# Derive "the last release" from OUR git tags, never from crates.io.
#
# This is load-bearing twice over:
#
# 1. An unrelated `dit` crate (0.0.1, 2022) squats the name on crates.io. With
# registry lookups on, release-plz reads that as "registry 0.0.1 < local
# 0.3.x" and parks a phantom release PR open forever (the bug PR #39 chased).
# 2. `publish = false` alone does NOT stop those lookups — the release-plz docs
# are explicit: "release-plz will still use the cargo registry to check
# what's the latest release". Only `git_only` does, and it skips
# `cargo publish` on its own.
#
# The obvious-looking alternative — `publish = false` in **Cargo.toml** — is a
# trap. It silences release-plz entirely: per its FAQ it "publishes all
# packages, except: packages with `publish = false` in the Cargo.toml", so
# `release-pr` returned {"prs":[]} and `release` said "nothing to release" on
# every green run between v0.3.0 and v0.3.1, and no release PR was ever opened.
# `git_only = true` is what makes a private package eligible again
# (release-plz PR #2603, "consider private git_only packages", in 0.3.160+),
# which is why Cargo.toml keeps its `publish = false` guard alongside this.
git_only = true
# release.yml owns the GitHub Release (it attaches the built binaries), so
# release-plz must NOT create one…
git_release_enable = false
Expand Down