mirror of
https://github.com/0xMassi/webclaw.git
synced 2026-04-25 00:06:21 +02:00
QEMU arm64 Rust builds took 60+ min and timed out in CI. Now the Docker job downloads the pre-built release binaries and packages them directly. - Dockerfile.ci: slim image for CI (downloads pre-built binaries) - Dockerfile: full source build for local dev (unchanged build stage) - Both use ubuntu:24.04 (GLIBC 2.39 matches CI build environment) - Multi-arch manifest combines amd64 + arm64 images Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
180 lines
5.4 KiB
YAML
180 lines
5.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: "--cfg reqwest_unstable"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: x86_64-apple-darwin
|
|
os: macos-latest
|
|
- target: aarch64-apple-darwin
|
|
os: macos-latest
|
|
- target: x86_64-unknown-linux-gnu
|
|
os: ubuntu-latest
|
|
- target: aarch64-unknown-linux-gnu
|
|
os: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ matrix.target }}
|
|
|
|
# Cross-compilation support for aarch64-linux
|
|
- name: Install cross-compilation tools
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu
|
|
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
run: cargo build --release --target ${{ matrix.target }}
|
|
|
|
- name: Package
|
|
shell: bash
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
staging="webclaw-${tag}-${{ matrix.target }}"
|
|
mkdir "$staging"
|
|
cp target/${{ matrix.target }}/release/webclaw "$staging/" 2>/dev/null || true
|
|
cp target/${{ matrix.target }}/release/webclaw-mcp "$staging/" 2>/dev/null || true
|
|
cp README.md LICENSE "$staging/"
|
|
tar czf "$staging.tar.gz" "$staging"
|
|
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.target }}
|
|
path: ${{ env.ASSET }}
|
|
|
|
release:
|
|
name: Release
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Compute checksums
|
|
run: |
|
|
cd artifacts
|
|
find . -name '*.tar.gz' -exec mv {} . \;
|
|
sha256sum *.tar.gz > SHA256SUMS
|
|
cat SHA256SUMS
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/*.tar.gz
|
|
artifacts/SHA256SUMS
|
|
|
|
docker:
|
|
name: Docker
|
|
needs: release
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- platform: linux/amd64
|
|
binary_target: x86_64-unknown-linux-gnu
|
|
- platform: linux/arm64
|
|
binary_target: aarch64-unknown-linux-gnu
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Download pre-built binaries from the release instead of recompiling
|
|
- name: Download release binaries
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
tarball="webclaw-${tag}-${{ matrix.binary_target }}.tar.gz"
|
|
curl -sSL "https://github.com/0xMassi/webclaw/releases/download/${tag}/${tarball}" -o release.tar.gz
|
|
tar xzf release.tar.gz
|
|
mkdir -p binaries
|
|
find . -name 'webclaw' -not -name 'webclaw-mcp' -path '*/webclaw-*/' -exec cp {} binaries/webclaw \;
|
|
find . -name 'webclaw-mcp' -exec cp {} binaries/webclaw-mcp \;
|
|
chmod +x binaries/*
|
|
ls -la binaries/
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.ci
|
|
push: true
|
|
platforms: ${{ matrix.platform }}
|
|
tags: ghcr.io/0xmassi/webclaw:${{ github.ref_name }}-${{ matrix.binary_target }}
|
|
build-args: |
|
|
BINARY_DIR=binaries
|
|
|
|
docker-manifest:
|
|
name: Docker Manifest
|
|
needs: docker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create multi-arch manifest
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
docker manifest create ghcr.io/0xmassi/webclaw:${tag} \
|
|
ghcr.io/0xmassi/webclaw:${tag}-x86_64-unknown-linux-gnu \
|
|
ghcr.io/0xmassi/webclaw:${tag}-aarch64-unknown-linux-gnu
|
|
docker manifest push ghcr.io/0xmassi/webclaw:${tag}
|
|
|
|
docker manifest create ghcr.io/0xmassi/webclaw:latest \
|
|
ghcr.io/0xmassi/webclaw:${tag}-x86_64-unknown-linux-gnu \
|
|
ghcr.io/0xmassi/webclaw:${tag}-aarch64-unknown-linux-gnu
|
|
docker manifest push ghcr.io/0xmassi/webclaw:latest
|
|
|
|
homebrew:
|
|
name: Update Homebrew
|
|
needs: release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Update Homebrew formula
|
|
uses: mislav/bump-homebrew-formula-action@v3
|
|
with:
|
|
formula-name: webclaw
|
|
homebrew-tap: 0xMassi/homebrew-webclaw
|
|
download-url: https://github.com/0xMassi/webclaw/releases/download/${{ github.ref_name }}/webclaw-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
|
|
env:
|
|
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|