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

ci(goreleaser): use latest tag from GitHub action #4094

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Dec 7, 2024

Closes #4081

Testing

On my fork all of these releases used the correct tag and uploaded prebuilt binaries.

@rootulp rootulp self-assigned this Dec 7, 2024
@rootulp rootulp marked this pull request as ready for review December 7, 2024 01:37
@rootulp rootulp requested a review from a team as a code owner December 7, 2024 01:37
@rootulp rootulp requested review from cmwaters, rach-id, evan-forbes and ninabarbakadze and removed request for a team December 7, 2024 01:37
Copy link
Contributor

coderabbitai bot commented Dec 7, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the GitHub Actions workflows and the Makefile to enhance the handling of release events. The ci-release.yml workflow is updated to trigger on published releases, and the goreleaser job is conditioned to execute only during these events. The goreleaser.yml workflow similarly restricts its jobs to run on release events and sets an environment variable for the current tag. The Makefile streamlines the tag retrieval process and replaces references to an old variable with the new one.

Changes

File Change Summary
.github/workflows/ci-release.yml Added trigger for release events of type published and conditional execution for goreleaser job.
.github/workflows/goreleaser.yml Updated jobs to run only on release events and set GORELEASER_CURRENT_TAG environment variable.
Makefile Simplified GIT_TAG handling, updated VERSION assignment, and replaced GIT_TAG with GORELEASER_CURRENT_TAG.

Assessment against linked issues

Objective Addressed Explanation
Instruct GoReleaser to use latest tag plumbed in via Github action (#4081)

Possibly related PRs

  • chore: ci regex matching clean up and docker workflow update #3908: This PR modifies the .github/workflows/ci-release.yml file to simplify regex patterns for triggering CI workflows, which is directly related to the changes made in the main PR that also updates the same file for handling release events.
  • fix: instruct GoReleaser to use current tag #4044: This PR updates the Makefile to ensure that the GORELEASER_CURRENT_TAG environment variable is used correctly, which aligns with the changes in the main PR that also involve the goreleaser job and its execution context during release events.

Suggested labels

backport:v3.x, external

Suggested reviewers

  • evan-forbes
  • cmwaters
  • ninabarbakadze
  • staheri14

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.

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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f11a169 and cdc8cc4.

📒 Files selected for processing (3)
  • .github/workflows/ci-release.yml (2 hunks)
  • .github/workflows/goreleaser.yml (3 hunks)
  • Makefile (3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/goreleaser.yml

18-18: shellcheck reported issue in this script: SC2086:info:1:71: Double quote to prevent globbing and word splitting

(shellcheck)


41-41: shellcheck reported issue in this script: SC2086:info:1:71: Double quote to prevent globbing and word splitting

(shellcheck)

🔇 Additional comments (6)
.github/workflows/ci-release.yml (2)

12-13: LGTM! Well-defined release event trigger.

The addition of the release event trigger with the 'published' type ensures precise control over when the workflow runs.


27-27: LGTM! Appropriate conditional execution.

The condition ensures the goreleaser job only runs during release events, preventing unnecessary executions.

.github/workflows/goreleaser.yml (2)

10-10: LGTM! Consistent conditional execution.

Both jobs are properly configured to run only during release events, maintaining consistency with ci-release.yml.

Also applies to: 31-31


27-28: LGTM! Proper environment variable configuration.

The GORELEASER_CURRENT_TAG is correctly passed to the required steps.

Also applies to: 50-51

Makefile (2)

1-1: LGTM! Robust version detection.

The VERSION variable now properly handles cases with and without tags, with a fallback to the commit hash.


207-207: LGTM! Consistent environment variable usage.

The GORELEASER_CURRENT_TAG is correctly used in both goreleaser commands, maintaining consistency with the workflow changes.

Also applies to: 225-225

.github/workflows/goreleaser.yml Show resolved Hide resolved
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

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

utAck

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.

Instruct GoReleaser to use latest tag plumbed in via Github action
2 participants