Skip to content

Conversation

@SandPod
Copy link
Contributor

@SandPod SandPod commented Feb 28, 2025

Enable CI job for deploying to pub.dev when a release tag is created.

The tag needs to start with v followed by a semver number and then optionally followed by any character. For example, v1.2.3 or v1.2.3-pre.1

Follows the guide here: https://dart.dev/tools/pub/automated-publishing#configuring-automated-publishing-from-github-actions-on-pub-dev

Note on regex

Seems like Github uses the glob pattern but treats some characters different (*, **, +, ?, ! ) meaning that . does not need to be escaped but will be treated as a single dot.

Tested patterns listed above in a different repo:

Screenshot 2025-02-28 at 08 21 52

Source:

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced an automated publishing process for CLI tools triggered by new version tags, streamlining the deployment of updates.
    • Added a PUBLISH.md file with guidelines for publishing CLI tools, including versioning and tagging instructions.

@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a new GitHub Actions workflow file named publish.yaml to automate the publishing process for Dart-based CLI tools. The workflow is activated on pushes to tags that conform to semantic versioning patterns and includes a job called publish, which utilizes the publish.yml workflow from the dart-lang/setup-dart repository. Additionally, a new file PUBLISH.md has been added, providing guidelines for the tagging and publishing process, including adherence to Semantic Versioning rules.

Changes

File Change Summary
.github/workflows/publish.yaml Added a new workflow "Publish CLI Tools" to automate publishing when tags match a semantic versioning pattern. Utilizes dart-lang/setup-dart's publish.yml action.
PUBLISH.md Introduced guidelines for publishing CLI tools, including tagging process, Semantic Versioning rules, and methods for creating tags via GitHub releases.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub Actions
    participant Pw as Publish Workflow
    participant DS as Dart Setup

    Dev->>GH: Push tag (e.g., v1.2.3)
    GH->>Pw: Trigger publish job based on tag pattern
    Pw->>DS: Invoke dart-lang/setup-dart publish workflow
    DS-->>Pw: Return publishing result
    Pw-->>GH: Complete publish job
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9bc2e9 and b921f30.

📒 Files selected for processing (1)
  • PUBLISH.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • PUBLISH.md

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@SandPod SandPod requested a review from Isakdl February 28, 2025 06:54
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b007af and 4118081.

📒 Files selected for processing (1)
  • .github/workflows/publish.yaml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/publish.yaml

6-6: character '' is invalid for branch and tag names. only special characters [, ?, +, *, , ! can be escaped with . see man git-check-ref-format for more details. note that regular expression is unavailable. note: filter pattern syntax is explained at https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

(glob)


6-6: character '' is invalid for branch and tag names. only special characters [, ?, +, *, , ! can be escaped with . see man git-check-ref-format for more details. note that regular expression is unavailable. note: filter pattern syntax is explained at https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

(glob)

🔇 Additional comments (2)
.github/workflows/publish.yaml (2)

1-2: Workflow Name is Clear

The workflow name "Publish CLI Tools" clearly reflects its purpose and adds clarity to the CI configuration.


8-13: Job Configuration is Correct

The job "publish" is properly configured by setting the required id-token: write permission and correctly referencing the reusable workflow from dart-lang/setup-dart. This aligns with the Dart documentation for automated publishing.

@SandPod SandPod force-pushed the add-automatic-deploy-to-pub.dev branch from 4118081 to ea31c42 Compare February 28, 2025 07:07
@SandPod SandPod requested review from Isakdl and removed request for Isakdl February 28, 2025 09:28
@SandPod SandPod marked this pull request as draft February 28, 2025 09:28
@SandPod SandPod marked this pull request as ready for review February 28, 2025 09:29
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
PUBLISH.md (2)

11-11: Minor Language Correction: Possessive Form
Consider changing “GitHubs interface” to “GitHub's interface” to properly indicate possession.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~11-~11: You might be missing the article “the” here.
Context: ...erred way to create a new tag is to use GitHubs interface to create a new release. The...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


13-13: Punctuation Enhancement for Clarity
Adding a comma after “Instead” (i.e., “Instead, the CHANGELOG.md is our source of truth on pub.dev.”) would improve readability.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~13-~13: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...hub release do not need to be modified. Instead the CHANGELOG.md is our source of tru...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea31c42 and a9bc2e9.

📒 Files selected for processing (1)
  • PUBLISH.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
PUBLISH.md

[uncategorized] ~11-~11: You might be missing the article “the” here.
Context: ...erred way to create a new tag is to use GitHubs interface to create a new release. The...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~13-~13: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...hub release do not need to be modified. Instead the CHANGELOG.md is our source of tru...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)

🔇 Additional comments (1)
PUBLISH.md (1)

1-9: Clear and Informative Documentation Structure
The guidelines are well outlined and provide clear instructions on how to publish the package. The explanations on tag formats and usage of semantic versioning are concise and align with the automated publishing process outlined by Dart.

Copy link
Collaborator

@christerswahn christerswahn left a comment

Choose a reason for hiding this comment

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

Great automation! 🚀

@SandPod SandPod merged commit f3925da into main Feb 28, 2025
4 checks passed
@SandPod SandPod deleted the add-automatic-deploy-to-pub.dev branch February 28, 2025 12:15
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.

3 participants