-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat(workerctl): add version command and release workflow #50
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
base: main
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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
versionsubcommand 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.
| - 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 |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
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.
| include: | ||
| - os: windows | ||
| arch: amd64 | ||
| ext: .exe | ||
| exclude: | ||
| - os: windows | ||
| arch: arm64 |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
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.
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.
There was a problem hiding this 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 |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
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.
| dist/workerctl-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}.sha256 |
Add Cobra version metadata and a
versionsubcommand 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.