Skip to content

fix: release and goreleaser#5

Merged
shinokada merged 3 commits intomainfrom
ci-update-3
Mar 5, 2026
Merged

fix: release and goreleaser#5
shinokada merged 3 commits intomainfrom
ci-update-3

Conversation

@shinokada
Copy link
Copy Markdown
Owner

@shinokada shinokada commented Mar 5, 2026

Closes #

📑 Description

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Summary by CodeRabbit

  • New Features
    • Releases now include checksums, archives (including README/license) and Windows ZIPs; Homebrew and Scoop publishing added.
  • Chores
    • Expanded packaging (native packages, Homebrew, Scoop) with token-based publishing and enhanced release metadata for more reliable, reproducible artifacts.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ed5bc4e3-c87c-4f4d-b304-0e4446802207

📥 Commits

Reviewing files that changed from the base of the PR and between b27bef1 and 7c4bf1d.

📒 Files selected for processing (1)
  • .goreleaser.yaml

📝 Walkthrough

Walkthrough

Updates release automation: the GitHub Actions workflow consolidates permissions, fetches full history, and simplifies steps while forwarding HOMEBREW_TAP_TOKEN and SCOOP_BUCKET_TOKEN to the GoReleaser run; GoReleaser config gains explicit build/archive IDs, CGO disabled, ldflags list, archives, checksum, nfpm, Homebrew and Scoop packaging blocks. (50 words)

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
​.github/workflows/release.yml
Set top-level contents: write permission, removed per-job permissions, changed actions/checkout to fetch-depth: 0, removed QEMU/Buildx/GCR steps, set GoReleaser distribution: goreleaser, and injects HOMEBREW_TAP_TOKEN / SCOOP_BUCKET_TOKEN from secrets.
GoReleaser Configuration
.goreleaser.yaml
Reworked to named builds with id and CGO_ENABLED=0, converted ldflags to a list with explicit version -X, added archives (with format_overrides and extra files), checksum, nfpm packaging, and explicit brews and scoops sections including tokens and expanded metadata.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub Actions
  participant GR as GoReleaser
  participant Art as Release Artifacts
  participant HB as Homebrew API
  participant SC as Scoop Repository

  Dev->>GH: push tag / trigger release
  GH->>GH: checkout (fetch-depth: 0), set top-level permissions
  GH->>GR: run GoReleaser (env: HOMEBREW_TAP_TOKEN, SCOOP_BUCKET_TOKEN, distribution)
  GR->>GR: run build (CGO_ENABLED=0), apply ldflags, create archives & checksums, produce nfpm packages
  GR->>HB: publish Homebrew formula (using token)
  GR->>SC: publish Scoop bucket (using token)
  GR->>Art: upload artifacts (archives, checksums, packages)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through tags and fetched the whole tree,
Tidied the modules and built binaries free.
Zip, deb, rpm — I bundled with care,
Pushed Homebrew and Scoop with a token to spare.
A rabbit's release — light feet on the air.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: release and goreleaser' is overly broad and generic. While it references real components changed (release workflow and goreleaser config), it does not clearly convey the specific main changes such as permission restructuring, adding distribution platforms (Homebrew/Scoop), or token management. Consider a more specific title that highlights the primary change, such as 'fix: restructure release permissions and add Homebrew/Scoop packaging support' or 'fix: update goreleaser config with packaging and token management'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci-update-3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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

🧹 Nitpick comments (2)
.github/workflows/release.yml (2)

8-10: Consider if packages: write permission is needed.

The packages: write permission is typically required for pushing to GitHub Container Registry. Since the GoReleaser config doesn't include Docker/container publishing, this permission may be unnecessary. Removing unused permissions follows the principle of least privilege.

♻️ Optional: Remove if not needed
 permissions:
   contents: write
-  packages: write
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 8 - 10, Review the workflow
permissions block and remove the unnecessary elevated permission by deleting or
commenting out the "packages: write" entry under the permissions map (the
"permissions:" block that currently lists "contents: write" and "packages:
write") if your GoReleaser configuration does not publish Docker or push to
GitHub Package/Container Registry; retain "contents: write" if required and
ensure no other steps rely on "packages: write" before removing it.

24-25: Consider enabling Go module caching.

Disabling cache (cache: false) will cause every release build to re-download dependencies, slowing down the workflow. Unless there's a specific caching issue being worked around, enabling the cache improves build times.

♻️ Optional: Enable caching
       - name: Set up Go
         uses: actions/setup-go@v5
         with:
           go-version: '1.22'
-          cache: false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 24 - 25, The workflow currently
sets cache: false for the Go setup (see the go-version and cache keys);
re-enable module caching by changing the cache setting to true or to the
appropriate module cache mode (e.g., enable Go modules caching) so dependencies
are cached between runs—update the cache key in the release.yml step that
configures go-version to enable caching rather than false.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.goreleaser.yaml:
- Around line 27-29: The ldflags entry is targeting main.version which doesn't
exist so the version injection fails; update the ldflags value to point to the
actual variable in the cmd package (the version declared in cmd/root.go at line
72) by replacing -X main.version={{.Version}} with the full import path to the
cmd package (i.e. -X <your-module>/cmd.version={{.Version}}) so the linker sets
the correct cmd.version variable; edit the ldflags block in .goreleaser.yaml
accordingly.
- Around line 84-85: The Homebrew test currently invokes the CLI with a flag
(`--version`) which the tool does not support; update the test entry in the
.goreleaser.yaml test block to call the supported subcommand form by replacing
the argument "--version" with "version" so the test runs `gitstart version`
(locate the test block that runs system "#{bin}/gitstart", "--version" and
change that argument to "version").

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 8-10: Review the workflow permissions block and remove the
unnecessary elevated permission by deleting or commenting out the "packages:
write" entry under the permissions map (the "permissions:" block that currently
lists "contents: write" and "packages: write") if your GoReleaser configuration
does not publish Docker or push to GitHub Package/Container Registry; retain
"contents: write" if required and ensure no other steps rely on "packages:
write" before removing it.
- Around line 24-25: The workflow currently sets cache: false for the Go setup
(see the go-version and cache keys); re-enable module caching by changing the
cache setting to true or to the appropriate module cache mode (e.g., enable Go
modules caching) so dependencies are cached between runs—update the cache key in
the release.yml step that configures go-version to enable caching rather than
false.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34bd7101-4461-42b4-b02f-112f91d35452

📥 Commits

Reviewing files that changed from the base of the PR and between 5847756 and 828d892.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • .goreleaser.yaml

Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
.goreleaser.yaml (1)

71-74: Add explicit branch field to repository blocks to prevent default-branch migration issues.

Both brews and scoops repository configurations lack explicit branch fields. GoReleaser uses the repository's default branch if omitted, which can break publishing if the tap's default branch changes (e.g., from master to main). Add branch: main under each repository block:

Example fix
brews:
  - name: gitstart
    repository:
      owner: shinokada
      name: homebrew-gitstart
      branch: main
      token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"

scoops:
  - repository:
      owner: shinokada
      name: scoop-bucket
      branch: main
      token: "{{ .Env.SCOOP_BUCKET_TOKEN }}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.goreleaser.yaml around lines 71 - 74, The repository blocks in the brews
and scoops sections omit an explicit branch, causing GoReleaser to use the repo
default branch which can break when defaults change; update each repository
block (the brews entry for name: gitstart and the scoops repository entry) to
add branch: main alongside owner, name, and token so the tap publish targets the
intended branch explicitly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.goreleaser.yaml:
- Around line 5-7: The release pipeline currently runs "go mod tidy" from
before.hooks which can rewrite go.mod/go.sum on the tagged commit; remove the
"go mod tidy" entry from the before.hooks block in .goreleaser.yaml and instead
run module tidying in a separate pre-release CI job (or locally) so the tagged
source is not mutated—if you need a lightweight check in the release step,
replace it with a readonly check (e.g., run with GOFLAGS="-mod=readonly" or use
"go list -m all"/"go mod verify") rather than invoking "go mod tidy".

---

Nitpick comments:
In @.goreleaser.yaml:
- Around line 71-74: The repository blocks in the brews and scoops sections omit
an explicit branch, causing GoReleaser to use the repo default branch which can
break when defaults change; update each repository block (the brews entry for
name: gitstart and the scoops repository entry) to add branch: main alongside
owner, name, and token so the tap publish targets the intended branch
explicitly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 398cb62e-6cfb-4ec9-8efe-a822cf437307

📥 Commits

Reviewing files that changed from the base of the PR and between 828d892 and b27bef1.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • .goreleaser.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

@shinokada
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@shinokada shinokada merged commit b0741d8 into main Mar 5, 2026
5 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Mar 5, 2026
4 tasks
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