Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Extract binary from cargo-dist archive
run: |
tar -xzf dk-x86_64-unknown-linux-gnu.tar.gz
chmod +x dk

- name: Upload binary to server
uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0
with:
Expand Down
199 changes: 199 additions & 0 deletions .github/workflows/publish-linux-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Publish Linux Packages

on:
push:
tags:
- '*-?[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:

concurrency:
group: publish-linux-packages-${{ github.ref }}
cancel-in-progress: false

jobs:
build-deb:
name: Build .deb package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-deb-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-deb
run: cargo install cargo-deb --locked
- name: Build .deb package
run: cargo deb
- name: Upload deb artifact
uses: actions/upload-artifact@v4
with:
name: deb-package
path: target/debian/*.deb

build-rpm:
name: Build .rpm package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-rpm-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-generate-rpm
run: cargo install cargo-generate-rpm --locked
- name: Build release binary
run: cargo build --release
- name: Build .rpm package
run: cargo generate-rpm
- name: Upload rpm artifact
uses: actions/upload-artifact@v4
with:
name: rpm-package
path: target/generate-rpm/*.rpm

publish-apt:
name: Publish to APT repository
needs: build-deb
runs-on: ubuntu-22.04
steps:
- name: Download deb artifact
uses: actions/download-artifact@v4
with:
name: deb-package
path: ./debs

- name: Import GPG signing key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch --yes
# Trust the key fully
KEY_ID=$(gpg --list-secret-keys --keyid-format LONG hello@dakera.ai \
| grep sec | head -1 | awk '{print $2}' | cut -d/ -f2)
echo "${KEY_ID}:6:" | gpg --import-ownertrust

- name: Checkout apt-repo
uses: actions/checkout@v4
with:
repository: dakera-ai/apt-repo
token: ${{ secrets.APT_REPO_TOKEN }}
path: apt-repo

- name: Install APT repo tools
run: sudo apt-get install -y dpkg-dev apt-utils

- name: Add package and regenerate index
run: |
set -euo pipefail
DEB=$(ls ./debs/*.deb | head -1)
echo "Processing: $DEB"

# Place deb in pool
mkdir -p apt-repo/pool/main/d/dk/
cp "$DEB" apt-repo/pool/main/d/dk/

# Create Packages index
mkdir -p apt-repo/dists/stable/main/binary-amd64/
cd apt-repo
dpkg-scanpackages --multiversion pool/ > dists/stable/main/binary-amd64/Packages
gzip -k -f dists/stable/main/binary-amd64/Packages
xz -k -f dists/stable/main/binary-amd64/Packages

# Generate Release file
apt-ftparchive \
-o APT::FTPArchive::Release::Origin="Dakera AI" \
-o APT::FTPArchive::Release::Label="Dakera" \
-o APT::FTPArchive::Release::Suite="stable" \
-o APT::FTPArchive::Release::Codename="stable" \
-o APT::FTPArchive::Release::Architectures="amd64" \
-o APT::FTPArchive::Release::Components="main" \
-o APT::FTPArchive::Release::Description="Dakera AI CLI packages" \
release dists/stable/ > dists/stable/Release

# Sign the Release file
gpg --batch --yes --default-key "hello@dakera.ai" \
--clearsign -o dists/stable/InRelease dists/stable/Release
gpg --batch --yes --default-key "hello@dakera.ai" \
-abs -o dists/stable/Release.gpg dists/stable/Release

echo "APT repo updated successfully"

- name: Commit and push
run: |
cd apt-repo
git config user.email "platform@dakera.ai"
git config user.name "Dakera Platform Bot"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
VERSION="${{ github.ref_name }}"
git commit -m "feat: add dk ${VERSION} packages"
git push
fi

publish-rpm:
name: Publish to RPM repository
needs: build-rpm
runs-on: ubuntu-22.04
steps:
- name: Download rpm artifact
uses: actions/download-artifact@v4
with:
name: rpm-package
path: ./rpms

- name: Import GPG signing key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch --yes
KEY_ID=$(gpg --list-secret-keys --keyid-format LONG hello@dakera.ai \
| grep sec | head -1 | awk '{print $2}' | cut -d/ -f2)
echo "${KEY_ID}:6:" | gpg --import-ownertrust

- name: Checkout rpm-repo
uses: actions/checkout@v4
with:
repository: dakera-ai/rpm-repo
token: ${{ secrets.APT_REPO_TOKEN }}
path: rpm-repo

- name: Install createrepo_c
run: sudo apt-get install -y createrepo-c

- name: Add package and regenerate metadata
run: |
set -euo pipefail
RPM=$(ls ./rpms/*.rpm | head -1)
echo "Processing: $RPM"

mkdir -p rpm-repo/packages/
cp "$RPM" rpm-repo/packages/

# Regenerate all repository metadata
createrepo_c --update rpm-repo/

# Sign the repository metadata so dnf/yum clients can verify integrity
gpg --batch --yes --default-key "hello@dakera.ai" \
-abs -o rpm-repo/repodata/repomd.xml.asc rpm-repo/repodata/repomd.xml

echo "RPM repo updated and signed successfully"

- name: Commit and push
run: |
cd rpm-repo
git config user.email "platform@dakera.ai"
git config user.name "Dakera Platform Bot"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
VERSION="${{ github.ref_name }}"
git commit -m "feat: add dk ${VERSION} packages"
git push
fi
40 changes: 40 additions & 0 deletions .github/workflows/publish-snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Snap

on:
push:
tags:
- '*-?[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
channel:
description: 'Snap Store channel (stable/candidate/beta/edge)'
required: false
default: 'stable'

jobs:
snap:
name: Build and publish Snap package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Update version in snapcraft.yaml
run: |
# Extract version from tag: dk-v0.6.0 → 0.6.0
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#dk-v}"
VERSION="${VERSION#v}"
sed -i "s/^version: .*/version: \"${VERSION}\"/" snap/snapcraft.yaml
echo "Building snap version: ${VERSION}"

- name: Build snap
id: build
uses: snapcore/action-build@v1

- name: Publish to Snap Store
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: ${{ github.event.inputs.channel || 'stable' }}
18 changes: 18 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ httpmock = "0.8"
assert_cmd = "2.2"
predicates = "3.1"

[package.metadata.deb]
maintainer = "Dakera AI <hello@dakera.ai>"
copyright = "2024-2026, Dakera AI"
section = "utility"
priority = "optional"
assets = [
["target/release/dk", "usr/bin/", "755"],
]
extended-description = """\
Dakera CLI for querying and managing AI agent memory. \
Connect to Dakera server instances to manage agent memories, \
sessions, and knowledge graphs from the command line."""

[package.metadata.generate-rpm]
assets = [
{ source = "target/release/dk", dest = "/usr/bin/dk", mode = "0755" },
]

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/dk-{ target }.tar.gz"
bin-dir = "dk{ binary-ext }"
Expand Down
29 changes: 29 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: dk
base: core24
version: "0.6.0"
summary: Command-line interface for Dakera AI Agent Memory Platform
description: |
Dakera CLI for querying and managing AI agent memory.
Connect to Dakera server instances to manage agent memories,
sessions, and knowledge graphs from the command line.

Configure with: dk init
Documentation: https://docs.dakera.ai/cli

grade: stable
confinement: strict

parts:
dakera-cli:
plugin: rust
source: .
build-packages:
- libssl-dev
- pkg-config

apps:
dk:
command: bin/dk
plugs:
- network
- home