Skip to content

cleanup(ci): move to using goreleaser - #24

Merged
Cali0707 merged 1 commit into
mcpchecker:mainfrom
Cali0707:fix-release-action
Feb 27, 2026
Merged

cleanup(ci): move to using goreleaser#24
Cali0707 merged 1 commit into
mcpchecker:mainfrom
Cali0707:fix-release-action

Conversation

@Cali0707

@Cali0707 Cali0707 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

This simplifies our CI to have much less bash in the release process and align on tools used in mcpchecker core

Summary by CodeRabbit

  • Chores
    • Restructured nightly release workflow with a streamlined two-job approach for improved automation.
    • Simplified prerelease and release workflows by adopting GoReleaser as the unified release mechanism.
    • Introduced GoReleaser configuration for consistent artifact building, packaging, signing, and releasing.
    • Removed legacy build and release management targets.

@coderabbitai

coderabbitai Bot commented Feb 27, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request refactors the release workflow infrastructure by introducing GoReleaser as the primary release orchestration tool. GitHub workflows transition from multi-step jobs handling versioning, changelog extraction, and manual release creation to streamlined two-job patterns that delegate build, sign, and publish operations to GoReleaser. Makefile release targets are removed to avoid duplication.

Changes

Cohort / File(s) Summary
Workflow Restructuring
.github/workflows/nightly.yaml, .github/workflows/prerelease.yaml, .github/workflows/release.yaml
Renamed primary jobs, removed public job outputs (version, changelog_body), added id-token: write permissions, replaced multi-step changelog extraction and manual release creation with single GoReleaser invocation, introduced output-based control flow via skip_nightly flag, and refactored nightly workflow into separate check-commits and nightly-release jobs.
GoReleaser Configuration
.goreleaser.yaml
New configuration file defining cross-platform builds (linux, darwin, windows; amd64, arm64), zip archive packaging, cosign-based signing, automatic prerelease detection, and nightly release settings with single-release retention.
Makefile Cleanup
Makefile
Removed release orchestration targets (package-release, sign-release, release) and changelog processing pipeline (extract-changelog-unreleased, extract-changelog-version, validate-changelog-has-version, validate-version-tag, upload-release-assets).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through workflows new,
Where GoReleaser takes the queue,
No more manual signing games,
Just config files with cleaner names!
The builds now sing, the releases dance,
One command rules them all—pure chance!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: migrating CI release workflows to use GoReleaser instead of bash scripts.
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

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (2)
.goreleaser.yaml (1)

3-22: Binary naming may cause redundant paths in archives.

The binary name includes OS/Arch (Line 5: kubernetes-extension-{{ .Os }}-{{ .Arch }}), and the archive uses the same template (Line 22). This results in archives like kubernetes-extension-linux-amd64.zip containing a binary named kubernetes-extension-linux-amd64 (or .exe on Windows), which is redundant.

Consider using a fixed binary name and letting only the archive name distinguish platforms:

♻️ Suggested fix
 builds:
   - main: ./cmd
-    binary: "kubernetes-extension-{{ .Os }}-{{ .Arch }}"
+    binary: "kubernetes-extension"
     flags:
       - -trimpath
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.goreleaser.yaml around lines 3 - 22, The archive currently duplicates
platform info by embedding {{ .Os }}-{{ .Arch }} in both the binary name
(binary: "kubernetes-extension-{{ .Os }}-{{ .Arch }}") and the archive
name_template; change the binary to a fixed name (e.g., binary:
"kubernetes-extension") and keep name_template: "kubernetes-extension-{{ .Os
}}-{{ .Arch }}" so each ZIP is platform-specific but contains a consistently
named executable (Goreleaser will still add .exe on Windows automatically).
.github/workflows/prerelease.yaml (1)

36-42: Consider running tests before prerelease.

The release workflow (.github/workflows/release.yaml) includes a make test step before running GoReleaser, but this prerelease workflow does not. Prereleases can still reach users, so running tests would help catch issues early.

♻️ Suggested addition
       - name: Set up Go
         uses: actions/setup-go@v6
         with:
           go-version-file: 'go.mod'

+      - name: Run tests
+        run: make test
+
       - name: Install cosign
         uses: sigstore/[email protected]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/prerelease.yaml around lines 36 - 42, The workflow lacks a
test step before performing prerelease actions; add a step named like "Run
tests" that executes the project's test target (e.g., run "make test" or "go
test ./...") after the "Set up Go" step and before the "Install cosign" (or any
release/prerelease steps) so prerelease builds run the same tests as the release
workflow; update the job in .github/workflows/prerelease.yaml to include this
test step using the existing runner/context and ensure it fails the job on
non-zero exit so broken changes are caught early.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/nightly.yaml:
- Around line 27-36: The current git tag filter uses grep -v 'prerelease' which
won't match typical prerelease tags like v1.0.0-rc.1; update the LATEST_RELEASE
tag selection (the pipeline that assigns LATEST_RELEASE) to only include strict
semver release tags by replacing the grep filter with a regex that matches
^v[0-9]+\.[0-9]+\.[0-9]+$ so prereleases (e.g., v1.2.3-rc.1) and nightly tags
are excluded; keep the existing --sort and the later logic that computes
COMMITS_SINCE_RELEASE unchanged.

---

Nitpick comments:
In @.github/workflows/prerelease.yaml:
- Around line 36-42: The workflow lacks a test step before performing prerelease
actions; add a step named like "Run tests" that executes the project's test
target (e.g., run "make test" or "go test ./...") after the "Set up Go" step and
before the "Install cosign" (or any release/prerelease steps) so prerelease
builds run the same tests as the release workflow; update the job in
.github/workflows/prerelease.yaml to include this test step using the existing
runner/context and ensure it fails the job on non-zero exit so broken changes
are caught early.

In @.goreleaser.yaml:
- Around line 3-22: The archive currently duplicates platform info by embedding
{{ .Os }}-{{ .Arch }} in both the binary name (binary: "kubernetes-extension-{{
.Os }}-{{ .Arch }}") and the archive name_template; change the binary to a fixed
name (e.g., binary: "kubernetes-extension") and keep name_template:
"kubernetes-extension-{{ .Os }}-{{ .Arch }}" so each ZIP is platform-specific
but contains a consistently named executable (Goreleaser will still add .exe on
Windows automatically).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bde856 and 377f8b7.

📒 Files selected for processing (5)
  • .github/workflows/nightly.yaml
  • .github/workflows/prerelease.yaml
  • .github/workflows/release.yaml
  • .goreleaser.yaml
  • Makefile
💤 Files with no reviewable changes (1)
  • Makefile

Comment on lines 27 to 36
# Find the latest release tag (any x.y.z release)
LATEST_RELEASE=$(git tag -l 'v*.*.*' --sort=-version:refname | grep -v 'prerelease' | grep -v '^nightly' | head -n1)

if [ -z "$LATEST_RELEASE" ]; then
echo "No existing releases found, creating first nightly"
COMMITS_SINCE_RELEASE=$(git rev-list HEAD --count)
LATEST_RELEASE_COMMIT=""
else
echo "Latest release: $LATEST_RELEASE"
COMMITS_SINCE_RELEASE=$(git rev-list ${LATEST_RELEASE}..HEAD --count)
LATEST_RELEASE_COMMIT="$LATEST_RELEASE"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

The grep -v 'prerelease' filter may not match actual prerelease tags.

Prerelease tags typically follow the pattern v1.0.0-rc.1 or v1.0.0-alpha.1, not containing the literal string "prerelease". This filter likely has no effect. You probably want to exclude tags containing a hyphen after the version:

🐛 Suggested fix
          # Find the latest release tag (any x.y.z release)
-          LATEST_RELEASE=$(git tag -l 'v*.*.*' --sort=-version:refname | grep -v 'prerelease' | grep -v '^nightly' | head -n1)
+          LATEST_RELEASE=$(git tag -l 'v*.*.*' --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n1)

The regex ^v[0-9]+\.[0-9]+\.[0-9]+$ matches only strict semver release tags (e.g., v1.2.3) and excludes prereleases (v1.2.3-rc.1) and nightly tags.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/nightly.yaml around lines 27 - 36, The current git tag
filter uses grep -v 'prerelease' which won't match typical prerelease tags like
v1.0.0-rc.1; update the LATEST_RELEASE tag selection (the pipeline that assigns
LATEST_RELEASE) to only include strict semver release tags by replacing the grep
filter with a regex that matches ^v[0-9]+\.[0-9]+\.[0-9]+$ so prereleases (e.g.,
v1.2.3-rc.1) and nightly tags are excluded; keep the existing --sort and the
later logic that computes COMMITS_SINCE_RELEASE unchanged.

@nader-ziada nader-ziada left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@Cali0707
Cali0707 merged commit 5c73995 into mcpchecker:main Feb 27, 2026
2 checks passed
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.

2 participants