Auto-release on data/source changes to main - #434
Conversation
|
David's AICA here: flagging the required one-time setup so this doesn't silently no-op if merged. Keeping the PR in draft until these are done. This workflow is inert until all of the below exist — the bump commit + tag push to protected
Alternative to the App: a fine-grained PAT with the same Until then, merging this changes nothing (no permissions to push), so it's safe to sit as a draft while the org config is sorted. |
|
Closing because the release design is superseded by the tag-derived release flow merged in #622. |
What
Auto-cut a patch release whenever packaged data or package source lands on
main, so the Slack ask ("do releases whenever we merge to main") is satisfied without anyone hand-bumping versions or pushing tags.The goal isn't to push people to
@latest— it's the opposite: keep a fresh, pinnable version always available so a consumer can bumpgenai-pricesto a specific version in the same PR where they switch a model, instead of either floating@latestor hitting theraw.githubusercontentdata.jsonfrom prod (which not everyone wants to do).How
New
.github/workflows/release.yml, onpush: main:packages/python/genai_prices/**orpackages/js/src/**(the packaged artifacts —data.py/data.ts— and source).uv version --package genai-prices --bump patch+npm version patch --workspace=packages/js→ bumps all 4 version files (pyproject.toml,package.json,uv.lock,package-lock.json) in lockstep.Release vX.Y.Z+ tags + pushes tomain.release-pypi/release-npmjobs inci.ymlthat actually publish. No change to the publish path.No re-trigger loop: the version files the bump touches all sit outside the trigger
paths, so a release commit can't re-fire the workflow.concurrency: releaseserialises back-to-back merges so they don't race on a version number.The bump commit + tag push to protected
main, so the defaultGITHUB_TOKENwon't do (can't bypass the ruleset; its pushes also wouldn't re-trigger CI). Need:contents: write, installed on this repo.mainruleset bypass list.RELEASE_APP_ID+ repo secretRELEASE_APP_PRIVATE_KEY.(A fine-grained PAT with the same bypass works as a simpler alternative — swap the
create-github-app-tokenstep fortoken: ${{ secrets.RELEASE_PAT }}on checkout.)Opening as draft until the above is configured.
Notes / deliberate scope
mainre-runsci.ymltests (release jobs skipped — not a tag). Harmless; left as-is to avoid a[skip ci]that would also skip the tag's publish run (same SHA).@latestis still not advertised anywhere — this PR doesn't touch docs to encourage floating; it just makes pinning painless. Happy to add a short "two channels" note (pin a release vs. on-demand data fetch) in a follow-up if wanted.0.0.68;zizmorpasses on the workflow.