Skip to content

Set the release version in the repo instead of in CI - #48

Merged
bradymholt merged 2 commits into
mainfrom
set-release-version-in-repo
Aug 20, 2026
Merged

Set the release version in the repo instead of in CI#48
bradymholt merged 2 commits into
mainfrom
set-release-version-in-repo

Conversation

@bradymholt

@bradymholt bradymholt commented Aug 19, 2026

Copy link
Copy Markdown
Member

The publish GitHub Actions workflow previously bumped the version and pushed the commit to main, which the tier-1-repos ruleset blocks without a PAT. It also regenerated the client in CI to embed the new version, but openapi-generator isn't on the runner and generate.sh had no set -e, so that step silently did nothing: 4.3.0 and 4.4.0 shipped with __version__ = "4.2.0".

The version now comes from pyproject.toml on main, set by the same PR that regenerates the client, where the generator is actually installed. scripts/generate.sh takes an optional major/minor/patch argument (defaulting to minor) and bumps before generating. Publish only tests, builds, publishes, and releases the commit it checked out, all of which GITHUB_TOKEN can do, so GH_API_TOKEN can be deleted from repo secrets.

I also removed scripts/generate-and-pr.sh, which wrapped generate.sh but never used its version bump.

Same change as ynab/ynab-sdk-js#232.

The publish workflow bumped the version and pushed the commit to main,
which the tier-1-repos ruleset blocks without a PAT.  It also ran
generate.sh to embed the new version in the client, but
openapi-generator is not installed on the runner and generate.sh had no
set -e, so that step silently did nothing.  4.3.0 and 4.4.0 shipped with
__version__ = "4.2.0" and a matching stale user-agent.

The version now comes from pyproject.toml on main, set by the same PR
that regenerates the client, where the generator is actually installed.
generate.sh takes an optional major/minor/patch argument (defaulting to
minor) and bumps before generating.  Publish only tests, builds,
publishes, and releases the commit it checked out, all of which
GITHUB_TOKEN can do, so GH_API_TOKEN can be deleted from repo secrets.
@bradymholt
bradymholt marked this pull request as ready for review August 19, 2026 22:37
The script wrapped generate.sh with branch, commit, push, and PR
creation, but never used generate.sh's version bump: it called it with
"none" and bumped separately, leaving two entry points with different
semantics.  Regenerating and opening the PR is straightforward enough by
hand that the wrapper was not worth maintaining alongside it.
@bradymholt
bradymholt requested review from a team and eebs and removed request for a team August 19, 2026 22:45
@bradymholt
bradymholt merged commit 823f86c into main Aug 20, 2026
5 checks passed
@bradymholt
bradymholt deleted the set-release-version-in-repo branch August 20, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants