Skip to content

build(go): remove GOOS and GOARCH suffixes from binaries - #153

Merged
yhakbar merged 3 commits into
gruntwork-io:mainfrom
maddawik:build/remove-os-arch-suffixes-from-binaries
Jul 8, 2026
Merged

build(go): remove GOOS and GOARCH suffixes from binaries#153
yhakbar merged 3 commits into
gruntwork-io:mainfrom
maddawik:build/remove-os-arch-suffixes-from-binaries

Conversation

@maddawik

@maddawik maddawik commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

closes #152

Summary by CodeRabbit

  • Chores
    • Updated build and release workflows to use a consistent binary name across all OS/architecture combinations.
    • Reworked how release artifacts are collected and archived, organizing packages by platform with more explicit, platform-based filenames.
    • Improved Windows vs. non-Windows packaging and verification logic to match the new archive expectations.

@maddawik
maddawik requested a review from yhakbar as a code owner July 7, 2026 02:18
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74dddfa5-dd78-461c-8cae-0304fcb53f0c

📥 Commits

Reviewing files that changed from the base of the PR and between 2e89e53 and 8fa3620.

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

Walkthrough

Build and release GitHub Actions workflows now use fixed binary names instead of OS/arch-suffixed filenames. The build workflow writes and uploads terragrunt-ls per platform, and the release workflow packages per-platform artifacts and verifies the updated archive names.

Changes

Binary naming and packaging update

Layer / File(s) Summary
Fixed binary naming in build workflow
.github/workflows/build-go.yml
Build, verify, and upload steps now use a fixed terragrunt-ls base filename and a fixed artifact path instead of OS/arch-suffixed names.
Release archive packaging for per-platform directories
.github/workflows/release-go.yml
Artifact download no longer merges multiples; archive creation iterates per-platform directories, picks the right binary name per OS, sets executable permissions, and produces .zip/.tar.gz archives; verification checks the updated archive names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BuildGo as build-go.yml
  participant Artifacts as Uploaded Artifacts
  participant ReleaseGo as release-go.yml
  participant Archives as Archive Files

  BuildGo->>BuildGo: Build terragrunt-ls binary
  BuildGo->>Artifacts: Upload terragrunt-ls under platform name
  ReleaseGo->>Artifacts: Download artifacts to bin/terragrunt-ls_*/
  ReleaseGo->>ReleaseGo: Select terragrunt-ls or terragrunt-ls.exe per platform
  ReleaseGo->>Archives: Create terragrunt-ls_platform.zip / .tar.gz
  ReleaseGo->>ReleaseGo: Verify expected archive names
Loading

Poem

A binary once wore a long, clunky name,
OS and arch tags, always the same.
Now it's just terragrunt-ls, clean and neat,
Packed in folders, zipped up complete.
The release flow nods with a tidy little grin 📦

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: removing GOOS/GOARCH suffixes from built binaries.
Linked Issues check ✅ Passed The workflow changes rename binaries at build time as requested by #152, with matching release packaging updates.
Out of Scope Changes check ✅ Passed No unrelated changes stand out; the release workflow edits are supporting updates for the renamed build artifacts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/release-go.yml (1)

86-101: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Windows gets an unnecessary .tar.gz too.

The loop builds both .zip and .tar.gz for every platform, including windows. Tarballs for Windows binaries aren't typical (mason/nvim-lspconfig conventions usually pair .zip with Windows and .tar.gz with Unix), so this just doubles upload/verify work for an artifact nobody will use. Not a bug, but worth trimming to match the platform-naming conventions this PR is aiming for.

♻️ Optional: skip tar.gz for windows
           for platform_dir in bin/terragrunt-ls_*/; do
             platform=$(basename "$platform_dir")

             if [[ "$platform" == *windows* ]]; then
               binary="terragrunt-ls.exe"
+              (cd "$platform_dir" && zip "../${platform}.zip" "$binary")
             else
               binary="terragrunt-ls"
               chmod +x "${platform_dir}${binary}"
+              (cd "$platform_dir" && zip "../${platform}.zip" "$binary")
+              (cd "$platform_dir" && tar -czf "../${platform}.tar.gz" "$binary")
             fi
-
-            (cd "$platform_dir" && zip "../${platform}.zip" "$binary")
-            (cd "$platform_dir" && tar -czf "../${platform}.tar.gz" "$binary")
             echo "Created archives for $platform"
           done

Remember to also drop the corresponding windows_* tar.gz entries from the expected-assets list below (Line 144) if you go this route.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-go.yml around lines 86 - 101, Skip creating the
.tar.gz archive for Windows in the Create archives step so the release artifacts
match the expected platform conventions. Update the loop in the archive-building
script to only run the tar command for non-windows platforms while still
producing the .zip for Windows, and remove the corresponding windows_* .tar.gz
entries from the expected-assets list so verification stays aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/release-go.yml:
- Around line 86-101: Skip creating the .tar.gz archive for Windows in the
Create archives step so the release artifacts match the expected platform
conventions. Update the loop in the archive-building script to only run the tar
command for non-windows platforms while still producing the .zip for Windows,
and remove the corresponding windows_* .tar.gz entries from the expected-assets
list so verification stays aligned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 139f57bc-3fab-4e7f-90c9-34874c5190dc

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7a98e and 2e89e53.

📒 Files selected for processing (2)
  • .github/workflows/build-go.yml
  • .github/workflows/release-go.yml

@yhakbar
yhakbar merged commit 920477b into gruntwork-io:main Jul 8, 2026
7 checks passed
@maddawik
maddawik deleted the build/remove-os-arch-suffixes-from-binaries branch July 8, 2026 15:25
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.

Remove OS and Arch suffixes from binary names

2 participants