Repository navigation
ci: automate universal package releases with semantic-release - #4
Conversation
Hướng dẫn dành cho người reviewPR này chuyển đổi quy trình phát hành sang workflow semantic-release, được điều khiển bởi các PR Conventional Commit đã được xác thực và các lần push lên main, với cơ chế kiểm soát CI đa nền tảng có thể tái sử dụng, npm Trusted Publishing thông qua OIDC, tạo release trên GitHub và bảo vệ baseline v0.1.3. PR cũng đóng gói lại dự án dưới tên npm có scope, bổ sung tài liệu về thiết lập và khôi phục vận hành, thêm các bài kiểm thử hành vi phát hành, đồng thời cập nhật cấu hình kiểm thử package và workspace. Sơ đồ trình tự cho quy trình phát hành package có kiểm soátsequenceDiagram
participant Main as Main push
participant Publish as publish workflow
participant CI as Reusable CI
participant SR as semantic-release
participant NPM as npm
participant GitHub as GitHub
Main->>Publish: Trigger publish.yml
Publish->>CI: Validate github.sha
CI->>CI: Run checks on Ubuntu, macOS, and Windows
CI-->>Publish: Validation result
Publish->>SR: npm run release
SR->>NPM: Publish package with OIDC
SR->>GitHub: Create release and tags
Sơ đồ luồng lựa chọn release cho Conventional Commitflowchart TD
PR[PR title] --> Check{Conventional Commit title valid?}
Check -->|No| Block[Block PR]
Check -->|Yes| Merge[Merge to main]
Merge --> Analyze[semantic-release analyzes commits]
Analyze --> Type{Highest release type}
Type -->|fix or perf| Patch[Patch release]
Type -->|feat| Minor[Minor release]
Type -->|breaking change| Major[Major release]
Type -->|docs ci or other non-release| None[No release]
Các thay đổi theo tệp
Mẹo và lệnhTương tác với Sourcery
Tùy chỉnh trải nghiệmTruy cập dashboard của bạn để:
Nhận trợ giúp
Original review guide in EnglishReviewer's GuideThe PR converts releases to a semantic-release workflow driven by validated Conventional Commit PRs and pushes to main, with reusable cross-platform CI gating, npm Trusted Publishing via OIDC, GitHub release generation, and a safeguarded v0.1.3 baseline. It also repackages the project under its scoped npm name, documents operational setup and recovery, adds release behavior tests, and updates packaging and workspace test configuration. Sequence diagram for the gated package releasesequenceDiagram
participant Main as Main push
participant Publish as publish workflow
participant CI as Reusable CI
participant SR as semantic-release
participant NPM as npm
participant GitHub as GitHub
Main->>Publish: Trigger publish.yml
Publish->>CI: Validate github.sha
CI->>CI: Run checks on Ubuntu, macOS, and Windows
CI-->>Publish: Validation result
Publish->>SR: npm run release
SR->>NPM: Publish package with OIDC
SR->>GitHub: Create release and tags
Flow diagram for Conventional Commit release selectionflowchart TD
PR[PR title] --> Check{Conventional Commit title valid?}
Check -->|No| Block[Block PR]
Check -->|Yes| Merge[Merge to main]
Merge --> Analyze[semantic-release analyzes commits]
Analyze --> Type{Highest release type}
Type -->|fix or perf| Patch[Patch release]
Type -->|feat| Minor[Minor release]
Type -->|breaking change| Major[Major release]
Type -->|docs ci or other non-release| None[No release]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Xin chào - tôi đã phát hiện 1 vấn đề
Lời nhắc dành cho các tác nhân AI
Vui lòng xử lý các nhận xét từ bản đánh giá mã này:
## Các nhận xét riêng lẻ
### Nhận xét 1
<location path="package.json" line_range="2" />
<code_context>
{
- "name": "pi-apply-patch",
+ "name": "@paulpham157/apply-patch",
"version": "0.1.3",
"lockfileVersion": 3,
</code_context>
<issue_to_address>
**issue (broader_impact):** Quy trình phát hành ban đầu không xuất bản gói mới được đặt trong scope. Commit duy nhất đang được hợp nhất là `ci: automate universal package releases with semantic-release`, và trình phân tích Conventional Commits đã được cấu hình phân loại commit này là không tạo bản phát hành, vì vậy semantic-release bỏ qua việc xuất bản lên npm mặc dù `package.json` đã thay đổi từ `pi-apply-patch` thành `@paulpham157/apply-patch`; các lệnh cài đặt được ghi trong tài liệu sau đó sẽ trỏ đến một gói/phiên bản không tồn tại.
**Triggers:** Khi PR này được hợp nhất và quy trình `publish` đầu tiên chạy.
**Suggested fix:** Sử dụng loại commit kích hoạt phát hành cho việc di chuyển gói, hoặc cấu hình/thực hiện rõ ràng bản phát hành ban đầu của `@paulpham157/apply-patch@0.1.3` trước khi dựa vào việc phân loại của semantic-release.
</issue_to_address>Sourcery miễn phí cho các dự án mã nguồn mở - nếu bạn thấy các bài đánh giá của chúng tôi hữu ích, hãy cân nhắc chia sẻ chúng ✨
Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="package.json" line_range="2" />
<code_context>
{
- "name": "pi-apply-patch",
+ "name": "@paulpham157/apply-patch",
"version": "0.1.3",
"lockfileVersion": 3,
</code_context>
<issue_to_address>
**issue (broader_impact):** The initial release workflow does not publish the newly scoped package. The only commit being merged is `ci: automate universal package releases with semantic-release`, which the configured Conventional Commits analyzer classifies as no release, so semantic-release skips npm publication even though `package.json` changed from `pi-apply-patch` to `@paulpham157/apply-patch`; the documented install commands then resolve to a package/version that does not exist.
**Triggers:** When this PR is merged and the first `publish` workflow runs.
**Suggested fix:** Use a release-triggering commit type for the package migration, or explicitly configure/perform an initial release of `@paulpham157/apply-patch@0.1.3` before relying on semantic-release classification.
</issue_to_address>
Summary
Verification
npm run check(typecheck + biome)npm test(unit tests)npm pack --dry-run(release sanity)pi -e ./src/index.tssmoke-tested locally, if behavior changedapply_patch impact
[Unreleased]if user-facingTóm tắt bởi Sourcery
Tự động hóa việc xác thực đa nền tảng và phát hành semantic-release cho gói
apply-patchcó phạm vi.Tính năng mới:
main.Cải tiến:
Build:
CI:
Deployment:
Documentation:
Tests:
Chores:
Original summary in English
Tóm tắt bởi Sourcery
Tự động hóa việc phát hành gói có phạm vi lên npm và GitHub theo Conventional Commit sau khi được xác thực.
Tính năng mới:
main.Cải tiến:
Build:
CI:
Triển khai:
Tài liệu:
Kiểm thử:
Công việc định kỳ:
Original summary in English
Tóm tắt bởi Sourcery
Tự động hóa quy trình phát hành gói có phạm vi (scoped package) lên npm và GitHub dựa trên Conventional Commit sau khi đã được xác thực.
Tính năng mới:
Cải tiến:
Build:
CI:
Deployment:
Documentation:
Tests:
Chores:
Original summary in English
Tóm tắt bởi Sourcery
Tự động hóa các bản phát hành dựa trên Conventional Commit đã được xác thực cho gói universal apply-patch có phạm vi.
Tính năng mới:
Sửa lỗi:
Cải tiến:
Build:
CI:
Triển khai:
Tài liệu:
Kiểm thử:
Công việc khác:
Original summary in English
Summary by Sourcery
Automate validated Conventional Commit-based releases for the scoped universal apply-patch package.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Deployment:
Documentation:
Tests:
Chores: