Skip to content

ci: cut releases from a workflow that runs release.sh - #217

Merged
eddietejeda merged 1 commit into
mainfrom
ci/release-workflow
Oct 15, 2026
Merged

eddietejeda merged 1 commit into
mainfrom
ci/release-workflow

Conversation

@eddietejeda

Copy link
Copy Markdown
Contributor

Why

scripts/release.sh prepare and publish were only ever run from a laptop, which needs a clean checkout, gh, uv, and the right Python. Everything after the tag push already ran in CI.

What

  • New cut-release.yml:
    • workflow_dispatch with a bump input runs release.sh prepare as the Hotdata automation app, then enables squash auto-merge on the release PR. Branch protection gates the merge on checks and the review.
    • On merge of a release/v* PR, runs release.sh publish, which tags main and pushes. The app token is used so the tag push triggers publish.yml and release.yml.
  • release.sh: PR body and two comments updated to describe the CI path. No logic change.
  • RELEASING.md: the release steps are now one gh workflow run command.

How to release after this merges

gh workflow run cut-release.yml -f bump=minor

Trigger Cut Release with a bump kind; the prepare job runs release.sh
prepare and enables auto-merge on the release PR, and merging that PR
runs release.sh publish, whose tag push feeds the existing PyPI and
GitHub Release workflows. Both jobs act as the automation app so the PR
gets checks and the tag triggers publishing.
@eddietejeda
eddietejeda requested a review from a team as a code owner October 15, 2026 19:32
@eddietejeda
eddietejeda requested review from shefeek-jinnah and removed request for a team October 15, 2026 19:32
@eddietejeda
eddietejeda enabled auto-merge (squash) October 15, 2026 19:32
- name: Prepare release
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: ./scripts/release.sh prepare "${{ inputs.bump }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Pass inputs.bump through env: instead of expanding it inside run: (not blocking).

The runner substitutes ${{ inputs.bump }} into the shell text before release.sh validates the value. A value such as "; curl ... # runs as shell code with the app token in scope. publish.yml:43 (INPUT_TAG) and regenerate.yml:77 (TITLE) already use the env: pattern.

Suggested change
run: ./scripts/release.sh prepare "${{ inputs.bump }}"
BUMP: ${{ inputs.bump }}
run: ./scripts/release.sh prepare "$BUMP"

The suggestion replaces only the run: line. Keep the existing GH_TOKEN line above BUMP in the env: block.

client-id: Iv23liKBX2RYMoZIYuKa
private-key: ${{ secrets.HOTDATA_AUTOMATION_PRIVATE_KEY }}
owner: hotdata-dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The publish job tags the current tip of main, not the release PR's merge commit (not blocking).

release.sh publish runs git checkout "$base" and git pull --ff-only at scripts/release.sh:209-210. If another PR merges after the release PR and before this job runs, vX.Y.Z lands on the later commit. PyPI then ships code that the release PR and its changelog section do not describe.

Fix: after release.sh publish returns, compare git rev-parse HEAD with github.event.pull_request.merge_commit_sha and fail if they differ. A stricter fix is to let publish accept a ref argument and pass the merge commit SHA.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to the inline comment on cut-release.yml line 107: run the merge-commit check before release.sh publish, not after. After publish returns, the tag is already pushed. Compare git rev-parse origin/main with github.event.pull_request.merge_commit_sha in a step before "Tag and push".

@eddietejeda
eddietejeda merged commit f1fd013 into main Oct 15, 2026
4 checks passed
@eddietejeda
eddietejeda deleted the ci/release-workflow branch October 15, 2026 19:34
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.

1 participant