From 1b3088b5b57ee705b7fc4c00f7ebd22c138083ed Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 21 May 2026 10:54:45 +0000 Subject: [PATCH 1/3] feat(DAK-5407): migrate to cargo-dist release pipeline + extract deploy workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dist-workspace.toml: cargo-dist v0.26.0 config for dakera-cli - installers: shell + powershell + homebrew (npm excluded until DAK-5408) - targets: linux x86_64, macOS ARM, macOS Intel, Windows x86_64 - homebrew tap: dakera-ai/homebrew-tap, formula: dk - .github/workflows/release.yml: replace hand-rolled workflow with cargo-dist pipeline - jobs: plan → build-local-artifacts (4 targets) → build-global-artifacts → host - host job pushes Homebrew formula via HOMEBREW_TAP_TOKEN on each release - publish-crate job preserved alongside cargo-dist jobs - .github/workflows/deploy.yml: new workflow triggered by Release completion - downloads x86_64 Linux artifact from cargo-dist release artifacts - SCPs to production server (preserves existing deploy-binary behavior) HOMEBREW_TAP_TOKEN secret set in dakera-cli repo. homebrew-tap repo created: https://github.com/Dakera-AI/homebrew-tap Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/deploy.yml | 42 +++++++ .github/workflows/release.yml | 205 +++++++++++++++++++--------------- dist-workspace.toml | 19 ++++ 3 files changed, 175 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 dist-workspace.toml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0ae9c57 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Deploy Binary + +# Triggered after the Release workflow completes successfully. +# Downloads the Linux x86_64 binary from the Release artifacts and deploys it to production. +on: + workflow_run: + workflows: [Release] + types: [completed] + +jobs: + deploy-binary: + name: Deploy to Production + runs-on: ubuntu-latest + # Only deploy when the Release workflow succeeded + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Download Linux binary from release + uses: actions/download-artifact@v4 + with: + name: artifacts-x86_64-unknown-linux-gnu + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload binary to server + uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0 + with: + host: ${{ secrets.DEPLOY_HOST }} + username: ${{ secrets.DEPLOY_USER }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + source: "dk" + target: "/tmp/" + + - name: Install binary on server + uses: appleboy/ssh-action@0ff4204d59e8e51228ff73bce53f80d53301dee2 # v1.2.5 + with: + host: ${{ secrets.DEPLOY_HOST }} + username: ${{ secrets.DEPLOY_USER }} + key: ${{ secrets.DEPLOY_SSH_KEY }} + script: | + chmod +x /tmp/dk + mv /tmp/dk /home/dakera/.local/bin/dk + echo "✅ dk deployed from release ${{ github.event.workflow_run.head_branch }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa78905..51cc88f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,58 +1,135 @@ +# Code generated by `cargo dist` - DO NOT EDIT manually +# Edit dist-workspace.toml and re-run `cargo dist generate` to regenerate + name: Release +permissions: + contents: write + on: - release: - types: [published] + push: + tags: + - '*-?[0-9]+.[0-9]+.[0-9]+*' jobs: - build: - name: Build ${{ matrix.target }} - runs-on: ${{ matrix.os }} + plan: + runs-on: ubuntu-latest + outputs: + val: ${{ steps.plan.outputs.manifest }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.26.0/cargo-dist-installer.sh | sh" + - name: Cache cargo-dist + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/dist + key: ${{ runner.os }}-cargo-dist-v0.26.0 + - name: Run cargo-dist plan + id: plan + shell: bash + run: | + cargo dist plan --tag=${{ github.ref_name }} --output-format=json > plan.json + echo "manifest=$(cat plan.json)" >> "$GITHUB_OUTPUT" + cat plan.json + - name: Upload dist-manifest.json + uses: actions/upload-artifact@v4 + with: + name: artifacts-plan-dist-manifest + path: dist-manifest.json + + build-local-artifacts: + needs: plan + runs-on: "${{ matrix.runner }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} strategy: + fail-fast: false matrix: include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - artifact: dk - target: aarch64-apple-darwin - os: macos-latest - artifact: dk + os: macos + runner: macos-latest - target: x86_64-apple-darwin - os: macos-14 - artifact: dk - use_zigbuild: true + os: macos + runner: macos-13 + - target: x86_64-unknown-linux-gnu + os: linux + runner: ubuntu-22.04 - target: x86_64-pc-windows-msvc - os: windows-latest - artifact: dk.exe + os: windows + runner: windows-latest steps: - - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v4 with: - targets: ${{ matrix.target }} - - name: Install cargo-zigbuild - if: matrix.use_zigbuild == true - run: | - python3 -m pip install --break-system-packages ziglang - cargo install cargo-zigbuild - rustup target add ${{ matrix.target }} - rustup target list --installed - - name: Build (zigbuild) - if: matrix.use_zigbuild == true - run: cargo zigbuild --release --target ${{ matrix.target }} - - name: Build (native) - if: matrix.use_zigbuild != true - run: cargo build --release --target ${{ matrix.target }} - - name: Upload artifact - uses: actions/upload-artifact@v7 + submodules: recursive + - name: Install cargo-dist + shell: bash + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.26.0/cargo-dist-installer.sh | sh" + - name: Build artifacts + shell: bash + run: cargo dist build --print=linkage --output-format=json --target=${{ matrix.target }} > build-dist-${{ matrix.target }}.json + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: artifacts-${{ matrix.target }} + path: dist/ + + build-global-artifacts: + needs: plan + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.26.0/cargo-dist-installer.sh | sh" + - name: Build global artifacts (shell/powershell installer scripts, homebrew formula) + run: cargo dist build --output-format=json --global-artifacts > build-global.json + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: artifacts-global + path: dist/ + + host: + needs: + - plan + - build-local-artifacts + - build-global-artifacts + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 with: - name: dk-${{ matrix.target }} - path: target/${{ matrix.target }}/release/${{ matrix.artifact }} + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.26.0/cargo-dist-installer.sh | sh" + - name: Fetch all built artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: dist/ + merge-multiple: true + - name: Publish to GitHub Releases + push Homebrew formula + shell: bash + run: cargo dist host --steps=upload --steps=release --output-format=json + env: + HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + # Publish to crates.io on each release publish-crate: - name: Publish to crates.io + needs: plan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - name: Publish to crates.io run: | @@ -62,57 +139,3 @@ jobs: } env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - upload-binaries: - name: Upload Release Binaries - needs: build - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/download-artifact@v8 - - name: Rename artifacts with platform names - run: | - mv dk-x86_64-unknown-linux-gnu/dk dk-x86_64-unknown-linux-gnu/dk-x86_64-unknown-linux-gnu - mv dk-aarch64-apple-darwin/dk dk-aarch64-apple-darwin/dk-aarch64-apple-darwin - mv dk-x86_64-apple-darwin/dk dk-x86_64-apple-darwin/dk-x86_64-apple-darwin - - name: Upload binaries to release - uses: softprops/action-gh-release@v3 - with: - files: | - dk-x86_64-unknown-linux-gnu/dk-x86_64-unknown-linux-gnu - dk-aarch64-apple-darwin/dk-aarch64-apple-darwin - dk-x86_64-apple-darwin/dk-x86_64-apple-darwin - dk-x86_64-pc-windows-msvc/dk.exe - - deploy-binary: - name: Deploy Native Binary - runs-on: ubuntu-latest - needs: upload-binaries - continue-on-error: true - steps: - - name: Download Linux binary artifact - uses: actions/download-artifact@v8 - with: - name: dk-x86_64-unknown-linux-gnu - - - name: Upload binary to server - uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0 - with: - host: ${{ secrets.DEPLOY_HOST }} - username: ${{ secrets.DEPLOY_USER }} - key: ${{ secrets.DEPLOY_SSH_KEY }} - source: "dk" - target: "/tmp/" - - - name: Install binary on server - uses: appleboy/ssh-action@0ff4204d59e8e51228ff73bce53f80d53301dee2 # v1.2.5 - with: - host: ${{ secrets.DEPLOY_HOST }} - username: ${{ secrets.DEPLOY_USER }} - key: ${{ secrets.DEPLOY_SSH_KEY }} - script: | - chmod +x /tmp/dk - mv /tmp/dk /home/dakera/.local/bin/dk - echo "✅ dk ${{ github.ref_name }} deployed" - diff --git a/dist-workspace.toml b/dist-workspace.toml new file mode 100644 index 0000000..711dd56 --- /dev/null +++ b/dist-workspace.toml @@ -0,0 +1,19 @@ +[workspace] +members = ["cargo:dakera-cli"] + +[dist] +cargo-dist-version = "0.26.0" +ci = "github" +# npm installer excluded until DAK-5408 (npm org setup) is complete +installers = ["shell", "powershell", "homebrew"] +targets = [ + "x86_64-unknown-linux-gnu", + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", +] +pr-run-mode = "plan" +publish-jobs = ["homebrew"] +install-path = "CARGO_HOME" +tap = "dakera-ai/homebrew-tap" +formula = "dk" From fe90899e8e96e168cdc54620a71ac3fd542eb992 Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 21 May 2026 11:09:25 +0000 Subject: [PATCH 2/3] =?UTF-8?q?feat(DAK-5411):=20add=20Linux=20package=20m?= =?UTF-8?q?anager=20distribution=20=E2=80=94=20Snap,=20APT/deb,=20YUM/RPM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds three Linux distribution channels for dk CLI: **Phase 4a — Snap Store:** - snap/snapcraft.yaml: core24 base, rust plugin, strict confinement, network+home plugs - .github/workflows/publish-snap.yml: triggered on release tags, updates version from tag, builds and publishes to Snap Store stable channel - Requires: SNAPCRAFT_STORE_CREDENTIALS secret (Release agent to configure) **Phase 4b — APT/deb:** - Cargo.toml [package.metadata.deb]: maintainer, copyright, section, binary asset configuration for cargo-deb - publish-linux-packages.yml build-deb + publish-apt jobs: build .deb, regenerate Packages index with dpkg-scanpackages, sign Release with GPG, push to dakera-ai/apt-repo - GPG_PRIVATE_KEY and APT_REPO_TOKEN CI secrets configured **Phase 4c — YUM/RPM:** - Cargo.toml [package.metadata.generate-rpm]: binary asset at /usr/bin/dk - publish-linux-packages.yml build-rpm + publish-rpm jobs: build .rpm with cargo-generate-rpm, regenerate metadata with createrepo_c, push to dakera-ai/rpm-repo Infrastructure created: - https://github.com/Dakera-AI/apt-repo (public, GitHub Pages enabled) - https://github.com/Dakera-AI/rpm-repo (public, GitHub Pages enabled) - GPG signing key generated, public key at apt-repo/KEY.gpg Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/publish-linux-packages.yml | 184 +++++++++++++++++++ .github/workflows/publish-snap.yml | 40 ++++ Cargo.toml | 18 ++ snap/snapcraft.yaml | 29 +++ 4 files changed, 271 insertions(+) create mode 100644 .github/workflows/publish-linux-packages.yml create mode 100644 .github/workflows/publish-snap.yml create mode 100644 snap/snapcraft.yaml diff --git a/.github/workflows/publish-linux-packages.yml b/.github/workflows/publish-linux-packages.yml new file mode 100644 index 0000000..322057d --- /dev/null +++ b/.github/workflows/publish-linux-packages.yml @@ -0,0 +1,184 @@ +name: Publish Linux Packages + +on: + push: + tags: + - '*-?[0-9]+.[0-9]+.[0-9]+*' + workflow_dispatch: + +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: 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/ + + echo "RPM repo updated 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 diff --git a/.github/workflows/publish-snap.yml b/.github/workflows/publish-snap.yml new file mode 100644 index 0000000..27955de --- /dev/null +++ b/.github/workflows/publish-snap.yml @@ -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 (strip leading 'v' or 'dk-v' prefix) + VERSION="${{ github.ref_name }}" + VERSION="${VERSION#v}" + VERSION="${VERSION#dk-}" + 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' }} diff --git a/Cargo.toml b/Cargo.toml index 344ca4c..a72088d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,3 +54,21 @@ indicatif = "0.17" httpmock = "0.8" assert_cmd = "2.2" predicates = "3.1" + +[package.metadata.deb] +maintainer = "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" }, +] diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..0ed9bb7 --- /dev/null +++ b/snap/snapcraft.yaml @@ -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 From ffc5734ae90cba7a3e5d25c94d9431e41c895459 Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 21 May 2026 11:34:21 +0000 Subject: [PATCH 3/3] fix: swap version prefix stripping order in publish-snap.yml (DAK-5422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For tag dk-v0.6.0, the old order stripped 'v' first (no-op since tag starts with 'dk-') then 'dk-' leaving 'v0.6.0'. New order: strip 'dk-v' in one step, then strip plain 'v' as fallback for v-only tags. Result: dk-v0.6.0 → 0.6.0 (correct snap version) Co-Authored-By: Paperclip --- .github/workflows/publish-snap.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-snap.yml b/.github/workflows/publish-snap.yml index 27955de..3a6100a 100644 --- a/.github/workflows/publish-snap.yml +++ b/.github/workflows/publish-snap.yml @@ -20,10 +20,10 @@ jobs: - name: Update version in snapcraft.yaml run: | - # Extract version from tag (strip leading 'v' or 'dk-v' prefix) + # Extract version from tag: dk-v0.6.0 → 0.6.0 VERSION="${{ github.ref_name }}" + VERSION="${VERSION#dk-v}" VERSION="${VERSION#v}" - VERSION="${VERSION#dk-}" sed -i "s/^version: .*/version: \"${VERSION}\"/" snap/snapcraft.yaml echo "Building snap version: ${VERSION}"