Skip to content

Add CLI release pipeline for ARM64, x86-64, and RISC-V#7

Merged
FarisZR merged 3 commits intoagentic-clifrom
feature/release-cli-pipeline
Mar 31, 2026
Merged

Add CLI release pipeline for ARM64, x86-64, and RISC-V#7
FarisZR merged 3 commits intoagentic-clifrom
feature/release-cli-pipeline

Conversation

@FarisZR
Copy link
Copy Markdown
Owner

@FarisZR FarisZR commented Mar 31, 2026

Summary

  • Add .github/workflows/release-cli.yml that triggers on release publication
  • Cross-compiles the km CLI (bin/cli) for x86_64, aarch64, and riscv64gc Linux targets using cross-rs
  • Packages each architecture as both DEB and RPM installers
  • Also uploads bare binaries for backward compatibility with the existing install-cli.py script
  • All artifacts are published as GitHub Release assets (nothing committed to the repo)

Artifacts produced per release

Format x86_64 ARM64 RISC-V
Binary km-x86_64 km-aarch64 km-riscv64gc
DEB komodo-cli_<ver>_amd64.deb komodo-cli_<ver>_arm64.deb komodo-cli_<ver>_riscv64.deb
RPM komodo-cli-<ver>.x86_64.rpm komodo-cli-<ver>.aarch64.rpm komodo-cli-<ver>.riscv64.rpm

Test plan

  • Create a draft/pre-release to verify the workflow triggers correctly
  • Confirm all 9 artifacts appear in the GitHub release
  • Install the DEB on a Debian/Ubuntu system and verify km --help works
  • Install the RPM on a Fedora/RHEL system and verify km --help works

Summary by CodeRabbit

  • Chores
    • Added an automated release workflow that builds and packages precompiled CLI binaries for multiple Linux architectures, creates Debian and RPM packages, and publishes these artifacts to the project’s GitHub Release when a release is published.
  • Bug Fixes / Improvements
    • Fixed installer architecture detection to properly handle RISC‑V binaries and ensure the correct prebuilt binary is downloaded for each CPU architecture.

Copilot AI review requested due to automatic review settings March 31, 2026 21:49
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d349c369-d6ec-4b64-9ec1-2f2619f9d992

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7531f and 0f2d391.

⛔ Files ignored due to path filters (1)
  • docsite/docs/ecosystem/cli.mdx is excluded by !**/*.mdx
📒 Files selected for processing (1)
  • scripts/install-cli.py

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow that builds km across multiple Linux architectures, packages per-arch DEB/RPMs, and uploads release assets; also updates the CLI installer script to correctly select the RISC-V binary name when downloading.

Changes

Cohort / File(s) Summary
Release Workflow
.github/workflows/release-cli.yml
Adds a new multi-job workflow triggered on release publish. Jobs: build (cross-compile km for x86_64, aarch64, riscv64gc and upload per-arch artifacts), package-deb (download artifacts, create .deb per-arch), package-rpm (download artifacts, create .rpm per-arch), and release (collect artifacts and upload to GitHub Release).
Installer script
scripts/install-cli.py
Fixes architecture selection logic for binary download: adds explicit RISC-V branch (riscv64, riscv64gc) mapping to km-riscv64gc, removes unconditional default assignment, and ensures correct binary name used for non-aarch64/arm64 cases.

Sequence Diagram(s)

sequenceDiagram
    participant ReleaseEvent as Release event
    participant Runner as Actions runner
    participant Cross as cross (cross-compile)
    participant ArtifactStore as GitHub Actions artifacts
    participant DebPackager as dpkg-deb
    participant RpmPackager as rpmbuild
    participant GhRelease as GitHub Release (softprops/action-gh-release)

    ReleaseEvent->>Runner: trigger workflow (release published)
    Runner->>Cross: build km for x86_64, aarch64, riscv64gc
    Cross-->>Runner: km-x86_64, km-aarch64, km-riscv64gc
    Runner->>ArtifactStore: upload per-arch km artifacts
    Runner->>ArtifactStore: download per-arch km artifacts (package jobs)
    Runner->>DebPackager: create DEB packages per-arch
    DebPackager-->>ArtifactStore: upload komodo-cli_*.deb
    Runner->>RpmPackager: create RPM packages per-arch
    RpmPackager-->>ArtifactStore: upload komodo-cli-*.rpm
    Runner->>ArtifactStore: collect all km, .deb, .rpm into release-assets/
    Runner->>GhRelease: upload release-assets to GitHub Release
Loading
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: adding a CLI release pipeline that supports cross-compilation for ARM64, x86-64, and RISC-V architectures.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/release-cli-pipeline
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/release-cli-pipeline

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🤖 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/release-cli.yml:
- Line 9: The env var BINARY_NAME is defined but never used; either remove the
BINARY_NAME declaration or replace every hardcoded "km" in the workflow with the
variable reference ${{ env.BINARY_NAME }} so the workflow uses the env var
consistently (search for literal "km" occurrences and update them to ${{
env.BINARY_NAME }} or delete the BINARY_NAME line if you opt to keep literals).
- Around line 71-72: Remove the unnecessary checkout step by deleting the step
that uses actions/checkout@v4 from the release CLI workflow; this job only needs
the build artifact (keep any actions/download-artifact or similar
artifact-retrieval steps) so remove the "- uses: actions/checkout@v4" line and
any associated checkout-related configuration to avoid extra overhead.
- Around line 22-30: The matrix property "cross: true" is declared for all
platforms but never used; either remove the unused "cross" entries from the
matrix or make the Build step conditional on matrix.platform.cross so the
workflow chooses "cross" vs "cargo" appropriately. Locate the matrix entries
that set "cross: true" (and the platform targets like aarch64-unknown-linux-gnu
and riscv64gc-unknown-linux-gnu) and either delete the "cross" keys, or update
the Build job (the step named "Build") to branch on matrix.platform.cross and
run cross build when true and cargo build when false.
- Around line 168-175: The spec's %install block is trying to cp
%{buildroot}/../km (which doesn't exist because the binary is pre-staged into
BUILDROOT) and %license LICENSE references a LICENSE that isn't staged; remove
or empty the %install section (delete the mkdir/cp/chmod lines so rpmbuild uses
the pre-staged BUILDROOT as-is) and then either stage the LICENSE into the
buildroot before invoking rpmbuild so %license LICENSE is valid, or remove the
%license LICENSE line from the %files section (ensure /usr/bin/km remains listed
in %files).
- Around line 152-180: The heredoc writing to ~/rpmbuild/SPECS/komodo-cli.spec
(the line starting with "cat > ~/rpmbuild/SPECS/komodo-cli.spec <<EOF") is
indented by the YAML step and injects leading spaces into the RPM spec; remove
the leading indentation so the EOF marker and every line of the heredoc are
left-aligned (no leading spaces) in the workflow, ensuring the spec file lines
(Name, Version, %description, %install, %files, etc.) start at column 1;
alternatively, outdent the entire heredoc or use a non-indented approach (e.g.,
tee/printf) so the generated spec file has no leading whitespace.
- Around line 79-80: Remove the unused "Install cargo-deb" step that runs "cargo
install cargo-deb" from the GitHub Actions workflow; locate the job step with
name "Install cargo-deb" and the run command "cargo install cargo-deb" and
delete that step so the workflow no longer installs cargo-deb before the manual
dpkg-deb packaging.
- Around line 89-101: The heredoc used to write the control file is indented by
the YAML and therefore adds leading spaces that break Debian control parsing;
unindent the heredoc so its delimiter (<<EOF and EOF) and all lines inside the
control content start at column 0 (no leading whitespace), ensuring fields like
"Package:", "Version:" (VERSION), "Architecture:" (matrix.platform.deb_arch) and
others begin at column 0 and that the Description continuation line has exactly
one leading space per Debian policy.
- Around line 40-41: The "Install cross" workflow step installs from the git
HEAD which breaks reproducibility; update the step (the run that currently calls
`cargo install cross --git https://github.com/cross-rs/cross`) to pin to a
stable ref by adding either a specific tag or commit via the cargo install flags
(use `--tag v0.2.5` to pin to the stable release or `--rev <commit-hash>` to pin
to a recent commit), so the workflow consistently installs the exact `cross`
version you expect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 06a21965-6f87-4f0b-89ee-bd60145856d3

📥 Commits

Reviewing files that changed from the base of the PR and between cf0fb5f and 542464f.

📒 Files selected for processing (1)
  • .github/workflows/release-cli.yml

Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Comment thread .github/workflows/release-cli.yml Outdated
Copy link
Copy Markdown

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

Adds a GitHub Actions release workflow to build and publish multi-arch Linux release assets for the km CLI, aligning release distribution with the existing scripts/install-cli.py binary naming scheme.

Changes:

  • Introduces .github/workflows/release-cli.yml triggered on GitHub Release publication.
  • Cross-compiles km for x86_64, aarch64, and riscv64gc and uploads per-arch raw binaries as artifacts.
  • Builds and uploads DEB/RPM packages per-arch, then attaches all artifacts to the GitHub Release.

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

Comment thread .github/workflows/release-cli.yml Outdated
Comment on lines +170 to +171
cp %{buildroot}/../km %{buildroot}/usr/bin/km
chmod +x %{buildroot}/usr/bin/km
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The RPM spec's %install section copies from %{buildroot}/../km, but this workflow never places a km file at that path (the downloaded binary is km-${{ matrix.platform.arch }} in the workspace, and you already copied it into BUILDROOT earlier). This will cause rpmbuild to fail during %install. Update the spec/workflow so the %install step installs the correct binary from a known location (e.g., pass it as Source0 or copy it into the build dir) and avoid the redundant pre-copy into BUILDROOT.

Suggested change
cp %{buildroot}/../km %{buildroot}/usr/bin/km
chmod +x %{buildroot}/usr/bin/km

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release-cli.yml Outdated
Comment on lines +173 to +175
%files
%license LICENSE
/usr/bin/km
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

%files declares %license LICENSE, but the LICENSE file is never installed into %{buildroot} during %install. rpmbuild will error out with a missing file. Either install LICENSE into the buildroot (e.g., under /usr/share/licenses/komodo-cli/) and list that path, or remove the %license entry.

Copilot uses AI. Check for mistakes.
Homepage: https://komo.do
EOF

dpkg-deb --build pkg komodo-cli_${VERSION}_${{ matrix.platform.deb_arch }}.deb
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The DEB is built with dpkg-deb --build pkg ... without ensuring root ownership in the package payload. This typically results in files owned by the runner's UID/GID inside the .deb, which is not desirable for system packages. Consider using dpkg-deb --root-owner-group --build pkg ... (or fakeroot) so installed files are owned by root:root.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release-cli.yml Outdated
targets: ${{ matrix.platform.target }}

- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

cargo install cross --git https://github.com/cross-rs/cross installs from an unpinned git HEAD, which makes releases non-reproducible and increases supply-chain risk. Pin to a specific released version (and use --locked) or use a dedicated action/versioned install method so the same release tag always builds with the same cross version.

Suggested change
run: cargo install cross --git https://github.com/cross-rs/cross
run: cargo install cross --version 0.2.5 --locked

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release-cli.yml Outdated
Comment on lines +79 to +81
- name: Install cargo-deb
run: cargo install cargo-deb

Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

cargo install cargo-deb is executed but the job does not use cargo deb (the DEB is assembled manually with dpkg-deb). This adds unnecessary time and potential install failures; remove the step or switch the packaging logic to actually use cargo-deb consistently.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release-cli.yml Outdated
Comment on lines +7 to +30
env:
CARGO_TERM_COLOR: always
BINARY_NAME: km

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
cross: true
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
arch: aarch64
cross: true
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
arch: riscv64gc
cross: true
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

BINARY_NAME and the matrix field cross: true are defined but never referenced in the workflow. Leaving unused configuration makes the workflow harder to maintain; either use these variables or remove them.

Copilot uses AI. Check for mistakes.
- Remove unused BINARY_NAME env var
- Remove unused 'cross: true' from matrix entries
- Pin cross install to v0.2.5 tag for reproducibility
- Remove unnecessary checkout steps from package-deb/package-rpm jobs
- Remove unused cargo-deb install step
- Fix DEB control file generation using printf to avoid heredoc indentation
- Fix RPM spec generation using printf to avoid heredoc indentation issues
- Remove broken %install section and %license LICENSE from RPM spec
- Pre-stage binary in BUILDROOT and use %files directly
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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/release-cli.yml:
- Around line 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.
- Around line 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.
- Around line 39-40: Update the "Build" step to explicitly specify the package
by adding -p komodo_cli to the cross build invocation: locate the step with name
"Build" and the existing command using --bin km and append -p komodo_cli so the
command becomes cross build --release -p komodo_cli --bin km --target ${{
matrix.platform.target }}; this makes the workspace build explicit and avoids
unnecessary package resolution.
- Around line 24-26: The release workflow now publishes riscv64gc binaries but
install-cli.py only recognizes x86_64 and aarch64 and cli.mdx only documents
those two; update scripts/install-cli.py to detect RISC-V (check
platform.machine() values like "riscv64" and "riscv64gc" or uname -m), add a
riscv mapping to the supported_archs/architecture selection logic and the
download URL/asset-name construction (the same place that handles
"x86_64"/"aarch64"), and ensure the installer falls back with a clear message if
the binary is unavailable; also update docsite/docs/ecosystem/cli.mdx to include
riscv64/riscv64gc as a supported or explicitly documented manual-download option
with the correct filename/URL pattern so RISC-V users know where to get the
binary.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: db6d24c5-d9bf-485a-9d26-13e039a266a2

📥 Commits

Reviewing files that changed from the base of the PR and between 542464f and 7e7531f.

📒 Files selected for processing (1)
  • .github/workflows/release-cli.yml

Comment on lines +24 to +26
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
arch: riscv64gc
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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify install-cli.py architecture detection
rg -n "aarch64|arm64|x86_64|riscv" scripts/install-cli.py

Repository: FarisZR/komodo-agentic-cli

Length of output: 231


🏁 Script executed:

#!/bin/bash
# Find and examine the documentation file
fd -i "cli.mdx" docsite/

Repository: FarisZR/komodo-agentic-cli

Length of output: 100


🏁 Script executed:

#!/bin/bash
# Check what the documentation says about supported architectures
rg -A 5 -B 5 "x86_64|aarch64|arm64|architecture|platform" docsite/docs/ecosystem/cli.mdx 2>/dev/null | head -50

Repository: FarisZR/komodo-agentic-cli

Length of output: 382


🏁 Script executed:

#!/bin/bash
# Check the full install-cli.py to understand the context
cat -n scripts/install-cli.py | head -80

Repository: FarisZR/komodo-agentic-cli

Length of output: 2545


🏁 Script executed:

#!/bin/bash
# Check the full release-cli.yml to see how riscv64gc is used
cat -n .github/workflows/release-cli.yml | head -100

Repository: FarisZR/komodo-agentic-cli

Length of output: 3823


🏁 Script executed:

#!/bin/bash
# Search for any artifact upload or release logic that might include riscv64gc
rg -n "riscv64|artifact|upload|release" .github/workflows/release-cli.yml

Repository: FarisZR/komodo-agentic-cli

Length of output: 1277


Update install-cli.py and documentation to support riscv64gc binaries.

The release workflow publishes riscv64gc binaries (lines 24-26, 64-65, 100-101), but scripts/install-cli.py only supports x86_64 and aarch64. Additionally, docsite/docs/ecosystem/cli.mdx only documents x86_64 / aarch64 support. Users on RISC-V systems cannot use the install script and have no documented download path.

Recommended fixes:

  • Update install-cli.py to detect and support riscv64 architecture
  • Update cli.mdx to document RISC-V support (either as fully supported or note the manual download requirement)
🤖 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 24 - 26, The release workflow
now publishes riscv64gc binaries but install-cli.py only recognizes x86_64 and
aarch64 and cli.mdx only documents those two; update scripts/install-cli.py to
detect RISC-V (check platform.machine() values like "riscv64" and "riscv64gc" or
uname -m), add a riscv mapping to the supported_archs/architecture selection
logic and the download URL/asset-name construction (the same place that handles
"x86_64"/"aarch64"), and ensure the installer falls back with a clear message if
the binary is unavailable; also update docsite/docs/ecosystem/cli.mdx to include
riscv64/riscv64gc as a supported or explicitly documented manual-download option
with the correct filename/URL pattern so RISC-V users know where to get the
binary.

Comment on lines +39 to +40
- name: Build
run: cross build --release --bin km --target ${{ matrix.platform.target }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 -30

Repository: FarisZR/komodo-agentic-cli

Length of output: 770


Consider adding -p komodo_cli to explicitly specify the package in workspace builds.

While --bin km works here since "km" is unique across the workspace, explicitly specifying the package with -p komodo_cli is a best practice that improves clarity and can slightly improve build performance by avoiding unnecessary package searches.

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
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-cli.yml around lines 39 - 40, Update the "Build"
step to explicitly specify the package by adding -p komodo_cli to the cross
build invocation: locate the step with name "Build" and the existing command
using --bin km and append -p komodo_cli so the command becomes cross build
--release -p komodo_cli --bin km --target ${{ matrix.platform.target }}; this
makes the workspace build explicit and avoids unnecessary package resolution.

Comment on lines +73 to +80
- 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
Copy link
Copy Markdown

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.

Comment on lines +120 to +131
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

CHANGELOG_DATE=$(date '+%a %b %d %Y')
printf 'Name: komodo-cli\nVersion: %s\nRelease: %s%%{?dist}\nSummary: Komodo CLI - command line tool for Komodo\n\nLicense: GPL-3.0-or-later\nURL: https://komo.do\nSource0: https://github.com/moghtech/komodo\n\nExclusiveArch: %s\n\n%%description\nCommand line tool for Komodo deployment management platform.\nProvides the '\''km'\'' binary for interacting with Komodo.\n\n%%files\n/usr/bin/km\n\n%%changelog\n* %s Komodo <becker.maxh@gmail.com> - %s-%s\n- Release %s\n' "$VERSION" "$RELEASE" "$RPM_ARCH" "$CHANGELOG_DATE" "$VERSION" "$RELEASE" "$VERSION" > ~/rpmbuild/SPECS/komodo-cli.spec

rpmbuild -bb \
--target ${RPM_ARCH} \
--buildroot ~/rpmbuild/BUILDROOT/${BUILDROOT} \
~/rpmbuild/SPECS/komodo-cli.spec
Copy link
Copy Markdown

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

An unexpected error occurred while generating fixes: Resource not accessible by integration - https://docs.github.com/rest/git/trees#create-a-tree

@FarisZR FarisZR merged commit 6cfeba2 into agentic-cli Mar 31, 2026
1 check 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