Skip to content

Conversation

@hyp3rd
Copy link
Owner

@hyp3rd hyp3rd commented Feb 3, 2026

Add Cobra version metadata and a version subcommand that prints build info (version/commit/date + runtime). Introduce a GitHub Actions workflow to cross-compile workerctl for linux/darwin/windows, generate SHA256 checksums, and upload artifacts to GitHub Releases. Update cspell wordlist for build flags.

Add Cobra version metadata and a `version` subcommand that prints build info
(version/commit/date + runtime). Introduce a GitHub Actions workflow to
cross-compile workerctl for linux/darwin/windows, generate SHA256 checksums,
and upload artifacts to GitHub Releases. Update cspell wordlist for build flags.
Copilot AI review requested due to automatic review settings February 3, 2026 17:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds version information capabilities to the workerctl CLI and introduces a GitHub Actions workflow for automated cross-platform releases. The version command displays build metadata (version, commit, date) alongside runtime information, and the release workflow builds binaries for multiple OS/architecture combinations with proper build flags.

Changes:

  • Added version subcommand to workerctl that prints build metadata and runtime information
  • Created GitHub Actions workflow for cross-compiling workerctl binaries and uploading to releases
  • Updated cspell dictionary with build-related terms (gochecknoglobals, ldflags, trimpath)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
cspell.json Added build flag terms to the spellcheck dictionary
cmd/workerctl/version.go Implements version command with build-time variables for version tracking
cmd/workerctl/root.go Integrates version command and metadata into the root CLI command
.github/workflows/workerctl-release.yml Defines multi-platform build and release automation workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 55 to 72
- name: Checksums
run: |
set -euo pipefail
(cd dist && sha256sum * > checksums.txt)

- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: workerctl-${{ matrix.os }}-${{ matrix.arch }}
path: dist/workerctl-${{ matrix.os }}-${{ matrix.arch }}*

- name: Upload release assets
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: |
dist/workerctl-${{ matrix.os }}-${{ matrix.arch }}*
dist/checksums.txt
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Each matrix job creates its own checksums.txt file containing only the checksum for that job's binary. When multiple jobs upload to the same release, the checksums.txt file will be overwritten by each job, resulting in only the last job's checksum being preserved. Consider either: (1) creating a separate checksums file per binary (e.g., workerctl-linux-amd64.sha256), (2) aggregating checksums in a separate job that depends on all build jobs, or (3) including the checksum in the binary's artifact name to avoid conflicts.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +25
include:
- os: windows
arch: amd64
ext: .exe
exclude:
- os: windows
arch: arm64
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The matrix configuration only defines the 'ext' variable for windows/amd64 combination. For linux and darwin builds, the EXT environment variable will be undefined or empty. While this works correctly (Unix binaries don't need extensions), it's inconsistent with the explicit include for Windows. Consider either removing the EXT variable usage (since it's only needed for Windows and the exclude already handles windows/arm64) or making the extension explicit for all platforms for consistency.

Copilot uses AI. Check for mistakes.
Add Cobra version metadata and a `version` subcommand that prints build info
(version/commit/date + runtime). Introduce a GitHub Actions workflow to
cross-compile workerctl for linux/darwin/windows, generate SHA256 checksums,
and upload artifacts to GitHub Releases. Update cspell wordlist for build flags.
Copilot AI review requested due to automatic review settings February 3, 2026 17:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with:
files: |
dist/workerctl-${{ matrix.os }}-${{ matrix.arch }}*
dist/workerctl-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}.sha256
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The second file pattern is redundant. Line 76 with the wildcard already matches all files including the sha256 checksum file. Line 77 will match the same checksum file that line 76 already matches, making it unnecessary.

Suggested change
dist/workerctl-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}.sha256

Copilot uses AI. Check for mistakes.
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