|
| 1 | +--- |
| 2 | +name: release-datafusion-ducklake |
| 3 | +description: Prepare and publish a new release of datafusion-ducklake to crates.io |
| 4 | +disable-model-invocation: true |
| 5 | +argument-hint: "[version]" |
| 6 | +allowed-tools: Bash(cargo check*), Bash(cargo build*), Bash(git checkout*), Bash(git pull*), Bash(git log*), Bash(git status*), Bash(git add*), Bash(git commit*), Bash(sleep*) |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +# Release datafusion-ducklake |
| 11 | + |
| 12 | +Prepare and publish a new release. The user may provide a version number as `$ARGUMENTS`. |
| 13 | + |
| 14 | +## Step 1: Determine version |
| 15 | + |
| 16 | +- If a version was provided (`$ARGUMENTS`), use it. Strip a leading `v` if present (e.g. `v0.0.7` -> `0.0.7`). |
| 17 | +- If no version was provided, read the current version from `Cargo.toml` and suggest the next patch bump. Ask the user to confirm or provide a different version. |
| 18 | + |
| 19 | +## Step 2: Ensure clean, up-to-date main branch |
| 20 | + |
| 21 | +- Confirm we're on `main` and the working tree is clean (`git status`). |
| 22 | +- Pull latest: `git pull`. |
| 23 | +- If the branch is dirty or not on main, warn the user and stop. |
| 24 | + |
| 25 | +## Step 3: Create release branch |
| 26 | + |
| 27 | +- Create and switch to a new branch: `git checkout -b release/v{VERSION}` |
| 28 | + |
| 29 | +## Step 4: Bump version |
| 30 | + |
| 31 | +- Update `version` in `Cargo.toml` (the `[package]` section, NOT workspace members). |
| 32 | +- Run `cargo check` to regenerate `Cargo.lock` with the new version. |
| 33 | +- Verify both `Cargo.toml` and `Cargo.lock` reflect the new version. |
| 34 | + |
| 35 | +## Step 5: Update CHANGELOG.md |
| 36 | + |
| 37 | +- Read `CHANGELOG.md` and the git log since the last tag (`git log $(git describe --tags --abbrev=0)..HEAD --oneline`). |
| 38 | +- Add a new `## [VERSION] - YYYY-MM-DD` section at the top (below the header), categorized as Added/Changed/Fixed per Keep a Changelog format. |
| 39 | +- Add a comparison link at the bottom: `[VERSION]: https://github.com/hotdata-dev/datafusion-ducklake/compare/v{PREV}...v{VERSION}` |
| 40 | +- Ask the user to review the changelog entries before committing. |
| 41 | + |
| 42 | +## Step 6: Update README.md if needed |
| 43 | + |
| 44 | +- Check if `README.md` references a version number (e.g. in dependency examples). If so, update to the new version. |
| 45 | + |
| 46 | +## Step 7: Commit and push |
| 47 | + |
| 48 | +- Stage `Cargo.toml`, `Cargo.lock`, `CHANGELOG.md`, and `README.md` (if changed). |
| 49 | +- **IMPORTANT**: Both `Cargo.toml` AND `Cargo.lock` must be committed. Missing the lock file will break the deploy. |
| 50 | +- Commit with message: `chore(release): prepare v{VERSION}` |
| 51 | +- Push the branch: `git push -u origin release/v{VERSION}` |
| 52 | + |
| 53 | +## Step 8: Create PR |
| 54 | + |
| 55 | +- Create a PR with `gh pr create` targeting `main`. |
| 56 | +- Title: `chore(release): prepare v{VERSION}` |
| 57 | +- Body should note the version bump and link to the changelog. |
| 58 | + |
| 59 | +## Step 9: Merge PR, tag, and trigger release |
| 60 | + |
| 61 | +After creating the PR, ask the user if they'd like to wait for CI or merge now. |
| 62 | + |
| 63 | +When the user is ready, merge the PR: |
| 64 | + |
| 65 | +``` |
| 66 | +gh pr merge --squash --delete-branch |
| 67 | +``` |
| 68 | + |
| 69 | +Then checkout main, pull, tag, and push: |
| 70 | + |
| 71 | +``` |
| 72 | +git checkout main && git pull |
| 73 | +``` |
| 74 | + |
| 75 | +Verify the merged changes are present (the new version should be in `Cargo.toml`). If not, stop and warn the user. |
| 76 | + |
| 77 | +``` |
| 78 | +git tag v{VERSION} && git push origin v{VERSION} |
| 79 | +``` |
| 80 | + |
| 81 | +## Step 10: Link to pending deployment |
| 82 | + |
| 83 | +After pushing the tag, wait a few seconds, then fetch the workflow run triggered by the tag: |
| 84 | + |
| 85 | +``` |
| 86 | +gh run list --workflow=release.yml --limit=1 --json databaseId,status,url |
| 87 | +``` |
| 88 | + |
| 89 | +Extract the run URL and print it for the user: |
| 90 | + |
| 91 | +> Tag `v{VERSION}` pushed. Release workflow started. |
| 92 | +> |
| 93 | +> **Approve the deployment here:** {RUN_URL} |
| 94 | +> |
| 95 | +> After approval and deployment: |
| 96 | +> - Confirm the new version on [crates.io](https://crates.io/crates/datafusion-ducklake) |
| 97 | +> - Confirm docs update on [docs.rs](https://docs.rs/datafusion-ducklake) (may take up to a day due to build queue) |
0 commit comments