-
Notifications
You must be signed in to change notification settings - Fork 4
merge dev to main (v3.0.0-alpha.6) #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* chore: fix version bump script output * update CI script
Co-authored-by: ymc9 <[email protected]>
WalkthroughThis update introduces a new GitHub Actions workflow for publishing and releasing packages, restricts the version bump workflow to the 'dev' branch, and improves version bumping automation by preserving file formatting and outputting the new version for downstream use. Multiple Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GitHub as GitHub Actions
participant NPM as NPM Registry
Dev->>GitHub: Push to main or manual dispatch (publish-release)
GitHub->>GitHub: Checkout code, setup pnpm & Node.js
GitHub->>GitHub: Install dependencies & build project
GitHub->>GitHub: Extract version from package.json
GitHub->>NPM: Publish packages with pnpm
GitHub->>GitHub: Generate changelog from git history
GitHub->>GitHub: Create draft prerelease with changelog
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Prepare for the v3.0.0-alpha.6
release by enhancing the bump script, updating package versions, and adding CI workflows for bumping and publishing.
- Enhance
scripts/bump-version.ts
to filter outnode_modules
, include the root package, emit the new version for GitHub Actions, and switch to string-based version replacement. - Bump all sample and workspace
package.json
files from3.0.0-alpha.5
to3.0.0-alpha.6
(and the VSCode extension from3.0.2
to3.0.3
). - Add two GitHub workflows: one to bump versions on
dev
(.github/workflows/bump-version.yml
) and one to publish prereleases onmain
(.github/workflows/publish-release.yml
).
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
scripts/bump-version.ts | Filter out node_modules , include root, emit new_version for CI, and update via string replace |
samples/blog/package.json (and all workspace package.json ) |
Bump version to 3.0.0-alpha.6 (VSCode extension bumped to 3.0.3 ) |
.github/workflows/bump-version.yml | Run only on dev branch and embed the new version in commit message and PR title |
.github/workflows/publish-release.yml | Define a workflow to build, publish packages, and create a prerelease draft on main |
Comments suppressed due to low confidence (1)
.github/workflows/publish-release.yml:6
- Triggering releases on any push to
main
may fire unexpectedly. Consider restricting to tag creation (e.g.,on: push: tags: ['v*']
) or using therelease
event to avoid unintended prereleases.
branches:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/publish-release.yml (1)
49-67
: Add error handling for changelog generation.The changelog generation logic could benefit from better error handling and formatting.
Improve the changelog generation with better error handling:
- name: Generate changelog id: changelog run: | + set -e PREVIOUS_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") if [ -z "$PREVIOUS_TAG" ]; then - CHANGELOG=$(git log --oneline --no-merges --format="* %s" HEAD) + CHANGELOG=$(git log --oneline --no-merges --format="* %s" HEAD 2>/dev/null || echo "") else - CHANGELOG=$(git log --oneline --no-merges --format="* %s" ${PREVIOUS_TAG}..HEAD) + CHANGELOG=$(git log --oneline --no-merges --format="* %s" ${PREVIOUS_TAG}..HEAD 2>/dev/null || echo "") fi if [ -z "$CHANGELOG" ]; then CHANGELOG="* Automated release" fi + # Escape special characters for GitHub output + CHANGELOG=$(echo "$CHANGELOG" | sed 's/\\/\\\\/g; s/"/\\"/g') + echo "changelog<<EOF" >> $GITHUB_OUTPUT echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
.github/workflows/bump-version.yml
(2 hunks).github/workflows/publish-release.yml
(1 hunks)package.json
(1 hunks)packages/cli/package.json
(1 hunks)packages/common-helpers/package.json
(1 hunks)packages/create-zenstack/package.json
(1 hunks)packages/eslint-config/package.json
(1 hunks)packages/ide/vscode/package.json
(1 hunks)packages/language/package.json
(1 hunks)packages/runtime/package.json
(1 hunks)packages/sdk/package.json
(1 hunks)packages/tanstack-query/package.json
(1 hunks)packages/testtools/package.json
(1 hunks)packages/typescript-config/package.json
(1 hunks)packages/zod/package.json
(1 hunks)samples/blog/package.json
(1 hunks)scripts/bump-version.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-test (20.x)
🔇 Additional comments (22)
packages/language/package.json (1)
4-4
: Version bump looks correct
3.0.0-alpha.6
matches the coordinated release version. No further action required.packages/sdk/package.json (1)
3-3
: Consistent version updateThe SDK package is aligned to
3.0.0-alpha.6
; nothing else changed. 👍packages/eslint-config/package.json (1)
3-3
: LGTMVersion bump is straightforward and safe.
packages/typescript-config/package.json (1)
3-3
: OK to mergeVersion field updated as expected.
samples/blog/package.json (1)
3-3
: Sample project version alignedSample blog moves to
3.0.0-alpha.6
; matches workspace packages. Make sure the rootpackage.json
has been bumped as well so thatpnpm i
keeps versions in sync.packages/zod/package.json (1)
3-3
: Version bump acknowledged and consistent
@zenstackhq/zod
is now at3.0.0-alpha.6
. Looks good and aligns with the monorepo bump.packages/runtime/package.json (1)
3-3
: Runtime package version updated correctly
@zenstackhq/runtime
moved to3.0.0-alpha.6
; no other metadata was touched.packages/common-helpers/package.json (1)
3-3
: Common-helpers version bump looks goodThe version synchronises with the rest of the workspace.
packages/tanstack-query/package.json (1)
3-3
: Tanstack-query package version increment verifiedPackage now references
3.0.0-alpha.6
; change is straightforward.package.json (1)
3-3
: Root workspace version alignedRoot
package.json
updated to3.0.0-alpha.6
, matching all sub-packages.packages/create-zenstack/package.json (1)
3-3
: Version bump looks goodThe new version string is consistent with the rest of the monorepo’s
alpha.6
release train. No further issues spotted.packages/ide/vscode/package.json (1)
4-4
: Confirm intentional divergence in versioning schemeAll other workspace packages move to
3.0.0-alpha.6
, while the VS Code extension advances to3.0.3
.
If this package intentionally follows its own semver track, no action is needed; otherwise please verify the version choice to avoid release-pipeline confusion.packages/cli/package.json (1)
6-6
: CLI version bump approvedThe CLI aligns with the
3.0.0-alpha.6
release. Looks good.packages/testtools/package.json (1)
3-3
: Test tools version bump approvedChange is consistent with other workspace packages.
.github/workflows/bump-version.yml (2)
13-13
: Nice guard – job limited to thedev
branchThe branch condition prevents accidental bumps on other branches.
35-44
: Verify that the bump script sets the new-version output correctly
steps.bump.outputs.new_version
is referenced for commit messages and PR titles, but the shell script run bypnpm run bump-version
must emit:echo "new_version=<value>" >> "$GITHUB_OUTPUT"Using the deprecated
::set-output
command will silently drop the output on newer runners, breaking the subsequent steps.
Please confirm the script uses the$GITHUB_OUTPUT
file or adjust the workflow accordingly.scripts/bump-version.ts (4)
20-20
: LGTM! Good improvement to exclude node_modules.The filter to exclude
node_modules
directories prevents processing unwanted package.json files that could be present in dependencies.
23-24
: LGTM! Including root package.json ensures consistency.Explicitly including the root package.json ensures it's always processed, which is important for maintaining version consistency across the workspace.
55-57
: LGTM! String replacement preserves formatting.Using string replacement instead of JSON.stringify preserves the original formatting and indentation of the package.json files, which is much better for maintainability.
62-65
: LGTM! Good CI integration with GitHub Actions output.The GitHub Actions output functionality allows downstream workflow steps to use the new version, enabling dynamic commit messages and PR titles.
.github/workflows/publish-release.yml (2)
3-7
: LGTM! Appropriate triggers for a release workflow.The workflow correctly triggers on manual dispatch and pushes to the main branch, which aligns with typical release practices.
9-11
: LGTM! Correct permissions for release creation.The
contents: write
permission is necessary for creating GitHub releases and pushing tags.
* chore: fix bump version script * update CI script * update
Summary by CodeRabbit