-
Notifications
You must be signed in to change notification settings - Fork 0
Add CLI release pipeline for ARM64, x86-64, and RISC-V #7
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,168 @@ | ||||||
| name: Release CLI | ||||||
|
|
||||||
| on: | ||||||
| release: | ||||||
| types: [published] | ||||||
|
|
||||||
| env: | ||||||
| CARGO_TERM_COLOR: always | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
| name: Build ${{ matrix.platform.target }} | ||||||
| runs-on: ${{ matrix.platform.os }} | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| platform: | ||||||
| - target: x86_64-unknown-linux-gnu | ||||||
| os: ubuntu-latest | ||||||
| arch: x86_64 | ||||||
| - target: aarch64-unknown-linux-gnu | ||||||
| os: ubuntu-latest | ||||||
| arch: aarch64 | ||||||
| - target: riscv64gc-unknown-linux-gnu | ||||||
| os: ubuntu-latest | ||||||
| arch: riscv64gc | ||||||
|
|
||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Install Rust toolchain | ||||||
| uses: dtolnay/rust-toolchain@stable | ||||||
| with: | ||||||
| targets: ${{ matrix.platform.target }} | ||||||
|
|
||||||
| - name: Install cross | ||||||
| run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.5 | ||||||
|
|
||||||
| - name: Build | ||||||
| run: cross build --release --bin km --target ${{ matrix.platform.target }} | ||||||
|
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if this is a workspace and if km binary is unique
cat Cargo.toml | head -20
echo "---"
# Find all Cargo.toml files that define a binary named km
rg -l '\[\[bin\]\]' --type toml | xargs -I{} sh -c 'echo "=== {} ===" && rg -A2 "name\s*=\s*\"km\"" {}'Repository: FarisZR/komodo-agentic-cli Length of output: 553 🏁 Script executed: cat bin/cli/Cargo.toml | head -30Repository: FarisZR/komodo-agentic-cli Length of output: 770 Consider adding While Suggested change - name: Build
- run: cross build --release --bin km --target ${{ matrix.platform.target }}
+ run: cross build --release -p komodo_cli --bin km --target ${{ matrix.platform.target }}🤖 Prompt for AI Agents |
||||||
|
|
||||||
| - name: Rename binary | ||||||
| run: | | ||||||
| mv target/${{ matrix.platform.target }}/release/km km-${{ matrix.platform.arch }} | ||||||
|
|
||||||
| - name: Upload binary artifact | ||||||
| uses: actions/upload-artifact@v4 | ||||||
| with: | ||||||
| name: km-${{ matrix.platform.arch }} | ||||||
| path: km-${{ matrix.platform.arch }} | ||||||
|
|
||||||
| package-deb: | ||||||
| name: DEB ${{ matrix.platform.arch }} | ||||||
| needs: build | ||||||
| runs-on: ubuntu-latest | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| platform: | ||||||
| - arch: x86_64 | ||||||
| deb_arch: amd64 | ||||||
| - arch: aarch64 | ||||||
| deb_arch: arm64 | ||||||
| - arch: riscv64gc | ||||||
| deb_arch: riscv64 | ||||||
|
|
||||||
| steps: | ||||||
| - name: Download binary | ||||||
| uses: actions/download-artifact@v4 | ||||||
| with: | ||||||
| name: km-${{ matrix.platform.arch }} | ||||||
|
|
||||||
| - name: Build DEB package | ||||||
| run: | | ||||||
| VERSION="${GITHUB_REF_NAME#v}" | ||||||
| mkdir -p pkg/DEBIAN pkg/usr/bin | ||||||
| chmod +x km-${{ matrix.platform.arch }} | ||||||
| cp km-${{ matrix.platform.arch }} pkg/usr/bin/km | ||||||
| printf 'Package: komodo-cli\nVersion: %s\nSection: utils\nPriority: optional\nArchitecture: %s\nDepends: libc6\nMaintainer: Max Becker <becker.maxh@gmail.com>\nDescription: Komodo CLI\n Command line tool for Komodo deployment management platform.\n Provides the '\''km'\'' binary for interacting with Komodo.\nHomepage: https://komo.do\n' "$VERSION" "${{ matrix.platform.deb_arch }}" > pkg/DEBIAN/control | ||||||
| dpkg-deb --build pkg komodo-cli_${VERSION}_${{ matrix.platform.deb_arch }}.deb | ||||||
|
||||||
| dpkg-deb --build pkg komodo-cli_${VERSION}_${{ matrix.platform.deb_arch }}.deb | |
| dpkg-deb --root-owner-group --build pkg komodo-cli_${VERSION}_${{ matrix.platform.deb_arch }}.deb |
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.
🧹 Nitpick | 🔵 Trivial
Consider validating VERSION format before building packages.
The VERSION="${GITHUB_REF_NAME#v}" extraction assumes tags follow the v* pattern. If a tag like 1.0.0 (without v prefix) is used, the version will be correct, but if an unexpected tag format is used, the DEB package could have an invalid version string. Debian package versions must follow specific rules (e.g., must start with a digit).
run: |
VERSION="${GITHUB_REF_NAME#v}"
+ # Validate version format (must start with digit for Debian)
+ if ! [[ "$VERSION" =~ ^[0-9] ]]; then
+ echo "Error: VERSION '$VERSION' does not start with a digit"
+ exit 1
+ fi
mkdir -p pkg/DEBIAN pkg/usr/bin🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/release-cli.yml around lines 73 - 80, Validate the VERSION
extracted from GITHUB_REF_NAME in the "Build DEB package" step by checking that
the VERSION variable matches a Debian-friendly pattern (e.g., starts with a
digit and follows numeric dot-separated segments); if it does not match, print a
clear error and exit before creating the pkg/DEBIAN/control file or calling
dpkg-deb. Update the block that sets VERSION="${GITHUB_REF_NAME#v}" to perform
the regex check on VERSION and fail fast (non-zero exit) or normalize it to a
safe form before using printf to write the control file and running dpkg-deb.
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.
🧹 Nitpick | 🔵 Trivial
Use $HOME instead of ~ for consistent path expansion in scripts.
The tilde (~) expansion is performed by the shell before command execution, but it may not expand consistently in all contexts (e.g., when used in variable assignments followed by command substitution). Using $HOME explicitly is more reliable.
- mkdir -p ~/rpmbuild/{SOURCES,SPECS,BUILD,RPMS}
- mkdir -p ~/rpmbuild/BUILDROOT/${BUILDROOT}/usr/bin
- cp km-${{ matrix.platform.arch }} ~/rpmbuild/BUILDROOT/${BUILDROOT}/usr/bin/km
- chmod +x ~/rpmbuild/BUILDROOT/${BUILDROOT}/usr/bin/km
+ mkdir -p "$HOME/rpmbuild"/{SOURCES,SPECS,BUILD,RPMS}
+ mkdir -p "$HOME/rpmbuild/BUILDROOT/${BUILDROOT}/usr/bin"
+ cp km-${{ matrix.platform.arch }} "$HOME/rpmbuild/BUILDROOT/${BUILDROOT}/usr/bin/km"
+ chmod +x "$HOME/rpmbuild/BUILDROOT/${BUILDROOT}/usr/bin/km"And similarly for the spec file path and rpmbuild command.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/release-cli.yml around lines 120 - 131, Replace all uses
of the tilde (~) with the explicit $HOME environment variable in the rpm build
steps to ensure reliable path expansion: update the mkdir, cp, chmod, printf
redirect (~/rpmbuild/SPECS/komodo-cli.spec) and the rpmbuild command invocations
that reference ~/rpmbuild/BUILDROOT/${BUILDROOT} or ~/rpmbuild/SPECS so they use
$HOME/rpmbuild/... instead; keep the same variables (BUILDROOT, RPM_ARCH,
VERSION, RELEASE, CHANGELOG_DATE) and command names (mkdir, cp, chmod, printf,
rpmbuild) unchanged.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: FarisZR/komodo-agentic-cli
Length of output: 231
🏁 Script executed:
Repository: FarisZR/komodo-agentic-cli
Length of output: 100
🏁 Script executed:
Repository: FarisZR/komodo-agentic-cli
Length of output: 382
🏁 Script executed:
Repository: FarisZR/komodo-agentic-cli
Length of output: 2545
🏁 Script executed:
Repository: FarisZR/komodo-agentic-cli
Length of output: 3823
🏁 Script executed:
Repository: FarisZR/komodo-agentic-cli
Length of output: 1277
Update
install-cli.pyand documentation to support riscv64gc binaries.The release workflow publishes
riscv64gcbinaries (lines 24-26, 64-65, 100-101), butscripts/install-cli.pyonly supportsx86_64andaarch64. Additionally,docsite/docs/ecosystem/cli.mdxonly documentsx86_64 / aarch64support. Users on RISC-V systems cannot use the install script and have no documented download path.Recommended fixes:
install-cli.pyto detect and supportriscv64architecturecli.mdxto document RISC-V support (either as fully supported or note the manual download requirement)🤖 Prompt for AI Agents