Skip to content
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

feat: Workflows for publishing from GH actions #409

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lesnitsky
Copy link

@lesnitsky lesnitsky commented Oct 15, 2024

Summary by CodeRabbit

  • New Features
    • Introduced three new GitHub Actions workflows:
      • Prepare Release: Facilitates the preparation of software releases with optional prerelease input.
      • Publish Packages: Automates the publishing of packages within the CI/CD pipeline.
      • Release Tag: Automates the tagging of releases based on specific commit messages.

Copy link

docs-page bot commented Oct 15, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/focustree/starknet.dart~409

Documentation is deployed and generated using docs.page.

Copy link
Contributor

coderabbitai bot commented Oct 15, 2024

Walkthrough

Three new GitHub Actions workflow files have been introduced: release-prepare.yaml, release-publish.yaml, and release-tag.yaml. Each workflow is designed to automate different aspects of the release process. The release-prepare.yaml file allows for manual preparation of software releases with an optional prerelease parameter. The release-publish.yaml automates the publishing of packages, while release-tag.yaml handles the tagging of releases based on specific commit messages. All workflows utilize the latest Ubuntu environment and include steps for checking out the repository and setting up the Flutter environment.

Changes

File Change Summary
.github/workflows/release-prepare.yaml New workflow added for preparing software releases with optional prerelease input.
.github/workflows/release-publish.yaml New workflow added to automate the publishing of packages.
.github/workflows/release-tag.yaml New workflow added to automate the tagging of releases based on commit messages.

Poem

🐰 In the meadow where the code does play,
New workflows hop in, brightening the day.
Prepare, publish, tag, all in a line,
Automating releases, oh how divine!
With each little step, we dance and we cheer,
For smooth software journeys, we hold so dear! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 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.

Copy link
Contributor

@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: 2

🧹 Outside diff range and nitpick comments (7)
.github/workflows/release-publish.yaml (2)

6-11: LGTM: Job configuration is well-defined.

The job name, permissions, and runner configuration are appropriate for the task of publishing packages. The 'contents: write' and 'id-token: write' permissions are necessary for updating the repository and authenticating with package registries.

Consider adding a comment explaining the need for the 'id-token: write' permission, as it might not be immediately obvious to all developers why this is required.


16-19: LGTM: Flutter setup and publishing steps are well-configured.

The use of subosito/flutter-action@v2 for setting up Flutter and bluefireteam/melos-action@v3 for publishing is appropriate. The publish: true parameter correctly triggers the publishing process.

Consider adding a step to verify the Flutter version and Dart SDK version before publishing. This can help ensure consistency across different environments. You could add something like:

      - name: Verify Flutter version
        run: flutter --version

This step would provide valuable information in the workflow logs and can help with debugging if issues arise.

.github/workflows/release-prepare.yaml (2)

11-17: LGTM: Job configuration looks good.

The job configuration is well-structured with appropriate permissions set. However, consider pinning the Ubuntu version for better reproducibility.

Consider replacing ubuntu-latest with a specific version, e.g., ubuntu-22.04, to ensure consistent behavior across runs.


23-28: LGTM: Well-configured Melos action for versioning and release preparation.

The Melos action is set up effectively with conditional versioning, dry run publishing, and PR creation. This configuration provides a robust release preparation process.

Consider adding a comment explaining the purpose of the Melos action and the significance of the run-versioning and run-versioning-prerelease options for better maintainability.

.github/workflows/release-tag.yaml (3)

7-12: Update job name to reflect its purpose.

The current job name "publish-packages" doesn't accurately reflect its primary purpose of creating tags for the release.

Consider renaming the job to better match its function:

jobs:
  create-release-tags:
    name: Create tags for release
    # ... rest of the job configuration

This change will make the workflow more self-descriptive and easier to understand at a glance.


15-18: Specify Flutter version for consistency.

While the workflow sets up the Flutter environment, it doesn't specify a particular Flutter version. This could potentially lead to inconsistencies if the default version changes.

Consider specifying a Flutter version in the subosito/flutter-action@v2 step:

- uses: subosito/flutter-action@v2
  with:
    flutter-version: '3.10.0' # Replace with your desired version
    channel: 'stable'

This ensures that the workflow always uses a consistent Flutter version, reducing the risk of unexpected behavior due to version changes.


19-21: Approve Melos usage and suggest version specification.

The use of Melos for managing the monorepo and creating tags is appropriate. However, consider specifying a Melos version for consistency.

You could update the Melos action step as follows:

- uses: bluefireteam/melos-action@v3
  with:
    melos-version: '3.1.0'
    tag: true

This ensures that a specific version of Melos is used, maintaining consistency across different runs of the workflow.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ffa4088 and 61387ba.

📒 Files selected for processing (3)
  • .github/workflows/release-prepare.yaml (1 hunks)
  • .github/workflows/release-publish.yaml (1 hunks)
  • .github/workflows/release-tag.yaml (1 hunks)
🧰 Additional context used
🔇 Additional comments (6)
.github/workflows/release-publish.yaml (3)

1-3: LGTM: Workflow name and trigger are appropriate.

The workflow name "Publish packages" clearly describes its purpose, and the manual trigger (workflow_dispatch) provides control over when package releases are initiated.


13-15: LGTM: Checkout step is correctly configured.

The use of the latest version of actions/checkout (v4) and setting fetch-depth: 0 ensures that the entire Git history is available. This is crucial for accurate versioning and generating changelogs during the publishing process.


1-19: Overall, this is a well-structured and appropriate workflow for publishing packages.

The workflow is concise, focused, and follows GitHub Actions best practices. It uses up-to-date versions of actions and correctly configures permissions and steps for publishing packages.

A few minor suggestions have been made to enhance clarity and robustness:

  1. Adding a comment explaining the 'id-token: write' permission.
  2. Including a step to verify the Flutter and Dart SDK versions.

These suggestions are optional improvements to an already solid workflow.

.github/workflows/release-prepare.yaml (3)

1-9: LGTM: Well-structured workflow trigger configuration.

The workflow name is clear, and the manual trigger with an optional prerelease input provides flexibility in the release preparation process.


19-22: LGTM: Proper setup for checkout and Flutter.

The checkout action fetches the full history, which is crucial for versioning. The Flutter setup is straightforward and uses a recent action version.


1-28: Overall, this is a well-implemented release preparation workflow.

The workflow effectively automates the release preparation process, providing flexibility for both regular and prerelease versions. It uses recent versions of actions and includes important steps such as full history checkout, Flutter setup, and versioning with Melos.

The minor suggestions provided (pinning Ubuntu version and adding comments) would further enhance maintainability and reproducibility, but the current implementation is already solid and ready for use.

.github/workflows/release-tag.yaml Show resolved Hide resolved
.github/workflows/release-tag.yaml Show resolved Hide resolved
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