Skip to content

Conversation

@MSevey
Copy link
Contributor

@MSevey MSevey commented May 22, 2024

Overview

Closes #1683

This PR copies over how celestia-app has implemented the goreleaser.
The goreleaser CI calls a makefile command so that in the event the CI fails, we can manually trigger the builds.

Tested on a temp repo:

  1. Pushing a tag locally triggers goreleaser to generate the release with the binaries.
  2. Creating a release via the github ui triggers goreleaser to update the release with the binaries.
  3. Deleted the binaries from v0.2.0 release to mimic the github action failing and pushed new ones locally with the makefile command.

https://github.com/MSevey/rollkit-temp/actions/workflows/goreleaser.yml
https://github.com/MSevey/rollkit-temp/releases

Summary by CodeRabbit

  • Chores

    • Updated .gitignore to exclude .env and .*env files.
    • Refined GitHub Actions workflows for better release management.
    • Introduced a new Goreleaser configuration for automated Go project releases.
  • New Features

    • Added support for creating prebuilt binaries for GitHub releases using Docker in the Makefile.

@MSevey MSevey added the C:ci Component: Continuous Integration label May 22, 2024
@MSevey MSevey self-assigned this May 22, 2024
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2024

Walkthrough

The recent updates streamlined the CI/CD process by removing redundant jobs, integrating Goreleaser for automated Go project releases, and refining the .gitignore file. Key additions include a new goreleaser.yml workflow and enhancements to the Makefile for creating prebuilt binaries. These changes aim to simplify release management and improve the overall development workflow.

Changes

File/Path Change Summary
.github/workflows/ci_release.yml Removed get_merged_pr_labels and release-merge jobs; renamed release-dispatch to release.
.github/workflows/goreleaser.yml Introduced a new workflow for automating Go project releases using Goreleaser.
.gitignore Updated to ignore .env and .*env files.
.goreleaser.yaml Added configurations for building and releasing a Go project with Goreleaser.
Makefile Added PACKAGE_NAME and GOLANG_CROSS_VERSION variables; introduced prebuilt-binary target.

🐰✨
In the burrows of our code,
New workflows lighten the load.
With Goreleaser's gentle breeze,
Releasing binaries with ease.
Gitignore now more refined,
Development streamlined.
🛠️🚀


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@MSevey MSevey marked this pull request as ready for review May 22, 2024 17:46
@RollkitBot RollkitBot requested review from a team, tuxcanfly, tzdybal and yarikbratashchuk and removed request for a team May 22, 2024 17:46
@MSevey MSevey enabled auto-merge May 22, 2024 17:48
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: 1

Outside diff range and nitpick comments (1)
.goreleaser.yaml (1)

35-44: Review the archive name template for compatibility.

The name template uses system architecture and OS, which is good. However, ensure that this naming convention fits well with your deployment and distribution strategies.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2ab3446 and 6aba043.
Files selected for processing (5)
  • .github/workflows/ci_release.yml (3 hunks)
  • .github/workflows/goreleaser.yml (1 hunks)
  • .gitignore (1 hunks)
  • .goreleaser.yaml (1 hunks)
  • Makefile (2 hunks)
Files skipped from review due to trivial changes (3)
  • .github/workflows/ci_release.yml
  • .github/workflows/goreleaser.yml
  • .gitignore
Additional comments not posted (4)
.goreleaser.yaml (3)

5-5: Ensure go mod tidy is sufficient for your pre-build hook.

This hook cleans up the modules by removing unnecessary dependencies. Verify if additional steps like go mod verify might be beneficial to ensure module integrity.


7-33: Configuration for builds looks comprehensive and well-documented.

The use of environment variables and ldflags is correctly implemented. The distribution path is also appropriately set.


46-56: Good use of checksums and git settings.

Checksum generation for file integrity and the use of a pre-release suffix in git configurations are best practices that enhance the reliability of the release process.

Makefile (1)

3-4: Addition of PACKAGE_NAME and GOLANG_CROSS_VERSION variables.

These variables are well-defined and crucial for the new prebuilt-binary target. Ensure they are documented in the Makefile or an associated README.

Copy link
Contributor

@yarikbratashchuk yarikbratashchuk left a comment

Choose a reason for hiding this comment

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

Lgtm 👍

@MSevey MSevey added this pull request to the merge queue May 30, 2024
Merged via the queue into main with commit 91fb0d9 May 30, 2024
@MSevey MSevey deleted the goreleaser branch May 30, 2024 01:09
@MSevey MSevey restored the goreleaser branch June 6, 2024 17:32
@MSevey MSevey deleted the goreleaser branch June 6, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C:ci Component: Continuous Integration

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add goreleaser CI

4 participants