Release #69
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- test-release # Test on specific branch | |
workflow_dispatch: # Allow manual testing | |
jobs: | |
build: | |
strategy: | |
fail-fast: false # Don't cancel other jobs if one fails | |
matrix: | |
include: | |
# Linux builds | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
binary-name: shimmy | |
artifact-name: shimmy-linux-x86_64 | |
features: "huggingface,llama" | |
# ARM64 Linux via native GitHub ARM64 runners | |
- os: ubuntu-22.04-arm | |
target: aarch64-unknown-linux-gnu | |
binary-name: shimmy | |
artifact-name: shimmy-linux-arm64 | |
features: "huggingface,llama" | |
# Windows builds | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
binary-name: shimmy.exe | |
artifact-name: shimmy-windows-x86_64.exe | |
features: "huggingface,llama" | |
# macOS builds | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
binary-name: shimmy | |
artifact-name: shimmy-macos-intel | |
features: "huggingface,llama" | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
binary-name: shimmy | |
artifact-name: shimmy-macos-arm64 | |
features: "huggingface,llama" # i8mm mixed-ISA issue resolved via production-grade fix | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install system dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake pkg-config | |
- name: Install system dependencies (Linux ARM64) | |
if: runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake pkg-config clang | |
- name: Install system dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
# cmake is usually pre-installed on GitHub runners | |
which cmake || brew install cmake | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Build binary | |
run: cargo build --release --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} | |
- name: Strip binary (Linux/macOS) | |
if: runner.os != 'Windows' | |
run: strip target/${{ matrix.target }}/release/${{ matrix.binary-name }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: target/${{ matrix.target }}/release/${{ matrix.binary-name }} | |
publish-crate: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Publish to crates.io | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish --no-verify | |
release: | |
needs: [build, publish-crate] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts | |
- name: Prepare release files | |
run: | | |
mkdir -p release-files | |
# Copy and rename artifacts with size info | |
echo "Preparing release files with size information..." | |
# Linux x86_64 | |
cp artifacts/shimmy-linux-x86_64/shimmy release-files/shimmy-linux-x86_64 | |
cp artifacts/shimmy-linux-x86_64/shimmy release-files/shimmy # Generic name | |
# Linux ARM64 | |
cp artifacts/shimmy-linux-arm64/shimmy release-files/shimmy-linux-arm64 | |
# Windows x86_64 | |
cp artifacts/shimmy-windows-x86_64.exe/shimmy.exe release-files/shimmy-windows-x86_64.exe | |
cp artifacts/shimmy-windows-x86_64.exe/shimmy.exe release-files/shimmy.exe # Generic name | |
# macOS Intel | |
cp artifacts/shimmy-macos-intel/shimmy release-files/shimmy-macos-intel | |
# macOS ARM64 | |
cp artifacts/shimmy-macos-arm64/shimmy release-files/shimmy-macos-arm64 | |
# Make binaries executable | |
chmod +x release-files/shimmy* | |
# Show file sizes and info | |
echo "Release files with sizes:" | |
ls -lah release-files/ | |
echo "Binary feature sets:" | |
echo " shimmy-linux-x86_64: SafeTensors + llama.cpp" | |
echo " shimmy-linux-arm64: SafeTensors + llama.cpp (native ARM64 runner)" | |
echo " shimmy-windows-x86_64.exe: SafeTensors + llama.cpp" | |
echo " shimmy-macos-intel: SafeTensors + llama.cpp" | |
echo " shimmy-macos-arm64: SafeTensors + llama.cpp (i8mm mixed-ISA issue resolved)" | |
- name: Generate changelog entry | |
id: changelog | |
run: | | |
# Get previous tag for changelog generation | |
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "") | |
CURRENT_TAG=${{ github.ref_name }} | |
if [ -n "$PREVIOUS_TAG" ]; then | |
echo "Generating changelog from $PREVIOUS_TAG to $CURRENT_TAG" | |
# Generate changelog content | |
CHANGELOG_CONTENT=$(cat << 'EOF' | |
## [$CURRENT_TAG] - $(date +%Y-%m-%d) | |
### Changes | |
$(git log --oneline --pretty=format:"- %s" ${PREVIOUS_TAG}..${CURRENT_TAG} | head -10) | |
### Full Changelog | |
See the [complete changelog](https://github.com/Michael-A-Kuykendall/shimmy/blob/main/CHANGELOG.md) for detailed release notes. | |
EOF | |
) | |
# Replace variables in changelog content | |
CHANGELOG_CONTENT=$(echo "$CHANGELOG_CONTENT" | sed "s/\$CURRENT_TAG/$CURRENT_TAG/g") | |
echo "changelog-content<<EOF" >> $GITHUB_OUTPUT | |
echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
else | |
echo "No previous tag found, using default changelog" | |
echo "changelog-content=Automatic release for $CURRENT_TAG" >> $GITHUB_OUTPUT | |
fi | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Create release notes combining changelog and platform info | |
RELEASE_NOTES=$(cat << 'EOF' | |
${{ steps.changelog.outputs.changelog-content }} | |
--- | |
**Cross-platform binaries with SafeTensors support:** | |
**Download the right binary for your platform:** | |
- **Linux x86_64**: `shimmy-linux-x86_64` (SafeTensors + llama.cpp) | |
- **Linux ARM64**: `shimmy-linux-arm64` (SafeTensors + llama.cpp, native ARM64 runner) | |
- **Windows x86_64**: `shimmy-windows-x86_64.exe` (SafeTensors + llama.cpp) | |
- **macOS Intel**: `shimmy-macos-intel` (SafeTensors + llama.cpp) | |
- **macOS Apple Silicon**: `shimmy-macos-arm64` (SafeTensors + llama.cpp) | |
All binaries include native SafeTensors support with zero Python dependencies. | |
**Quick Start:** | |
```bash | |
# Make executable (Linux/macOS) | |
chmod +x shimmy-* | |
# Test the binary | |
./shimmy-* --version | |
# Start server | |
./shimmy-* serve --bind 0.0.0.0:11434 | |
``` | |
EOF | |
) | |
gh release create ${{ github.ref_name }} \ | |
release-files/* \ | |
--title "Shimmy ${{ github.ref_name }}" \ | |
--notes "$RELEASE_NOTES" |