Skip to content

releases

releases #54

Workflow file for this run

name: releases
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v0.7.2)"
required: true
permissions:
contents: write
env:
GGML_NATIVE: "OFF"
MACOSX_DEPLOYMENT_TARGET: "14.0"
RELEASE_TAG: "${{ github.event.release.tag_name || github.event.inputs.tag }}"
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- {
runner: macos-latest,
osname: macOS,
arch: amd64,
target: x86_64-apple-darwin,
command: build,
}
- {
runner: macos-latest,
osname: macOS,
arch: arm64,
target: aarch64-apple-darwin,
command: build,
build_args: --features metal,
}
- {
runner: ubuntu-latest,
osname: linux,
arch: amd64,
target: x86_64-unknown-linux-gnu,
command: build,
}
- {
runner: ubuntu-latest,
osname: linux,
arch: amd64-noavx,
target: x86_64-unknown-linux-gnu,
command: build,
noavx: true,
}
- {
runner: ubuntu-24.04-arm,
osname: linux,
arch: arm64,
target: aarch64-unknown-linux-gnu,
command: build,
build_args: --no-default-features,
}
- {
runner: windows-latest,
osname: windows,
arch: amd64,
target: x86_64-pc-windows-msvc,
command: build,
extension: ".exe",
}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Install build dependencies (Linux)
if: matrix.osname == 'linux'
run: sudo apt-get update && sudo apt-get install -y cmake
- name: Get the release version from the tag
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Disable AVX for baseline build
if: matrix.noavx
shell: bash
run: |
echo "GGML_AVX=OFF" >> $GITHUB_ENV
echo "GGML_AVX2=OFF" >> $GITHUB_ENV
echo "GGML_FMA=OFF" >> $GITHUB_ENV
echo "GGML_F16C=OFF" >> $GITHUB_ENV
- name: Install Rust toolchain (native builds)
if: matrix.runner == 'ubuntu-24.04-arm'
uses: dtolnay/rust-toolchain@stable
- name: Build binary (native)
if: matrix.runner == 'ubuntu-24.04-arm'
run: cargo build --bin dria-node --release --target ${{ matrix.target }} ${{ matrix.build_args }}
- name: Strip binary (native)
if: matrix.runner == 'ubuntu-24.04-arm'
run: strip target/${{ matrix.target }}/release/dria-node
- name: Build binary (cross)
if: matrix.runner != 'ubuntu-24.04-arm'
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.command }}
target: ${{ matrix.target }}
args: "--bin dria-node --release ${{ matrix.build_args }}"
strip: true
- name: Prepare Release File
run: |
mv target/${{ matrix.target }}/release/dria-node${{ matrix.extension }} ./dria-node-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Upload Launch Artifacts
uses: actions/upload-artifact@v4
with:
name: dria-node-${{ matrix.osname }}-${{ matrix.arch }}
path: dria-node-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}
build-cuda:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- {
runner: ubuntu-latest,
osname: linux,
arch: amd64-cuda,
target: x86_64-unknown-linux-gnu,
cuda: "12.8.0",
}
- {
runner: windows-latest,
osname: windows,
arch: amd64-cuda,
target: x86_64-pc-windows-msvc,
cuda: "12.8.0",
extension: ".exe",
}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Install CUDA toolkit
uses: Jimver/cuda-toolkit@v0.2.22
with:
cuda: ${{ matrix.cuda }}
method: network
- name: Install build dependencies (Linux)
if: matrix.osname == 'linux'
run: sudo apt-get update && sudo apt-get install -y cmake
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build binary with CUDA
run: cargo build --bin dria-node --release --target ${{ matrix.target }} --features cuda
- name: Strip binary (Linux)
if: matrix.osname == 'linux'
run: strip target/${{ matrix.target }}/release/dria-node
- name: Prepare Release File
shell: bash
run: |
mv target/${{ matrix.target }}/release/dria-node${{ matrix.extension }} ./dria-node-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Upload Launch Artifacts
uses: actions/upload-artifact@v4
with:
name: dria-node-${{ matrix.osname }}-${{ matrix.arch }}
path: dria-node-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}
build-rocm:
runs-on: ubuntu-22.04
env:
LLAMA_BUILD_SHARED_LIBS: "1"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Install ROCm HIP SDK
run: |
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/rocm.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3.3 jammy main" | sudo tee /etc/apt/sources.list.d/rocm.list
printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n' | sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt-get update
sudo apt-get install -y --no-install-recommends cmake hip-dev rocm-hip-runtime-dev hipblas-dev rocblas-dev rocsolver-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build binary with ROCm
run: cargo build --bin dria-node --release --target x86_64-unknown-linux-gnu --features rocm
- name: Strip binary
run: strip target/x86_64-unknown-linux-gnu/release/dria-node
- name: Package ROCm bundle
shell: bash
run: |
TARGET_DIR=target/x86_64-unknown-linux-gnu/release
BUNDLE_DIR=dria-node-linux-amd64-rocm
mkdir -p "${BUNDLE_DIR}/lib"
mv "${TARGET_DIR}/dria-node" "${BUNDLE_DIR}/dria-node-bin"
cat > "${BUNDLE_DIR}/dria-node" <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
SOURCE="${BASH_SOURCE[0]}"
while [ -L "${SOURCE}" ]; do
DIR="$(cd -P "$(dirname "${SOURCE}")" && pwd)"
TARGET="$(readlink "${SOURCE}")"
if [[ "${TARGET}" != /* ]]; then
SOURCE="${DIR}/${TARGET}"
else
SOURCE="${TARGET}"
fi
done
DIR="$(cd -P "$(dirname "${SOURCE}")" && pwd)"
export LD_LIBRARY_PATH="${DIR}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
exec "${DIR}/dria-node-bin" "$@"
EOF
chmod +x "${BUNDLE_DIR}/dria-node" "${BUNDLE_DIR}/dria-node-bin"
shopt -s nullglob
copied=0
for lib in "${TARGET_DIR}"/*.so "${TARGET_DIR}"/*.so.*; do
cp -a "${lib}" "${BUNDLE_DIR}/lib/"
copied=1
done
if [ "${copied}" -eq 0 ]; then
echo "No shared libraries were produced for the ROCm build." >&2
exit 1
fi
if [ -f LICENSE ]; then
cp LICENSE "${BUNDLE_DIR}/LICENSE"
fi
tar -czf "${BUNDLE_DIR}.tar.gz" "${BUNDLE_DIR}"
- name: Upload Launch Artifacts
uses: actions/upload-artifact@v4
with:
name: dria-node-linux-amd64-rocm
path: dria-node-linux-amd64-rocm.tar.gz
release:
needs: [build, build-cuda, build-rocm]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Launch Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./artifacts
- name: Create release with artifacts
uses: ncipollo/release-action@v1
with:
name: ${{ env.RELEASE_TAG }}
tag: ${{ env.RELEASE_TAG }}
artifacts: "artifacts/*"
artifactContentType: application/octet-stream
allowUpdates: true
makeLatest: true
update_homebrew:
needs: release
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./artifacts
- name: Checkout homebrew tap
uses: actions/checkout@v4
with:
repository: firstbatchxyz/homebrew-dkn
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-dkn
- name: Update formula
run: |
VERSION="${{ env.RELEASE_TAG }}"
VERSION="${VERSION#v}"
SHA_MACOS_AMD64=$(sha256sum artifacts/dria-node-macOS-amd64 | cut -d' ' -f1)
SHA_MACOS_ARM64=$(sha256sum artifacts/dria-node-macOS-arm64 | cut -d' ' -f1)
SHA_LINUX_AMD64=$(sha256sum artifacts/dria-node-linux-amd64 | cut -d' ' -f1)
SHA_LINUX_ARM64=$(sha256sum artifacts/dria-node-linux-arm64 | cut -d' ' -f1)
FORMULA=homebrew-dkn/Formula/dria-node.rb
cat > "$FORMULA" << 'RUBY'
class DriaNode < Formula
desc "Dria Compute Node - run AI inference on the Dria network"
homepage "https://github.com/firstbatchxyz/dkn-compute-node"
version "VERSION_PLACEHOLDER"
license "Apache-2.0"
on_macos do
on_intel do
url "https://github.com/firstbatchxyz/dkn-compute-node/releases/download/vVERSION_PLACEHOLDER/dria-node-macOS-amd64"
sha256 "SHA_MACOS_AMD64_PLACEHOLDER"
end
on_arm do
url "https://github.com/firstbatchxyz/dkn-compute-node/releases/download/vVERSION_PLACEHOLDER/dria-node-macOS-arm64"
sha256 "SHA_MACOS_ARM64_PLACEHOLDER"
end
end
on_linux do
on_intel do
url "https://github.com/firstbatchxyz/dkn-compute-node/releases/download/vVERSION_PLACEHOLDER/dria-node-linux-amd64"
sha256 "SHA_LINUX_AMD64_PLACEHOLDER"
end
on_arm do
url "https://github.com/firstbatchxyz/dkn-compute-node/releases/download/vVERSION_PLACEHOLDER/dria-node-linux-arm64"
sha256 "SHA_LINUX_ARM64_PLACEHOLDER"
end
end
def install
binary = Dir.glob("dria-node*").first
bin.install binary => "dria-node"
end
test do
assert_match "dria-node", shell_output("#{bin}/dria-node --version")
end
end
RUBY
# Remove leading whitespace from heredoc
sed -i 's/^ //' "$FORMULA"
# Replace placeholders with actual values
sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" "$FORMULA"
sed -i "s/SHA_MACOS_AMD64_PLACEHOLDER/${SHA_MACOS_AMD64}/g" "$FORMULA"
sed -i "s/SHA_MACOS_ARM64_PLACEHOLDER/${SHA_MACOS_ARM64}/g" "$FORMULA"
sed -i "s/SHA_LINUX_AMD64_PLACEHOLDER/${SHA_LINUX_AMD64}/g" "$FORMULA"
sed -i "s/SHA_LINUX_ARM64_PLACEHOLDER/${SHA_LINUX_ARM64}/g" "$FORMULA"
- name: Commit and push
run: |
cd homebrew-dkn
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/dria-node.rb
git commit -m "Update dria-node to ${{ env.RELEASE_TAG }}"
git push