Release / Build darwin/amd64 (push) Canceled after 0s
Release / Build linux/amd64 (push) Canceled after 0s
Release / Build darwin/arm64 (push) Canceled after 0s
Release / Build linux/arm64 (push) Canceled after 0s
Release / Generate Homebrew Formula (push) Canceled after 0s
Release / GitHub Release (push) Canceled after 0s
Release / Docker Image (push) Canceled after 0s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
220 lines
6.1 KiB
YAML
220 lines
6.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
env:
|
|
GO_VERSION: "1.25"
|
|
NODE_VERSION: "20"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
suffix: ""
|
|
- goos: linux
|
|
goarch: arm64
|
|
suffix: ""
|
|
- goos: darwin
|
|
goarch: amd64
|
|
suffix: ""
|
|
- goos: darwin
|
|
goarch: arm64
|
|
suffix: ""
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Build web frontend
|
|
run: |
|
|
cd web && npm install --legacy-peer-deps && npm run build
|
|
|
|
- name: Copy web assets
|
|
run: |
|
|
rm -rf internal/web/dist
|
|
cp -r web/build internal/web/dist
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build binary
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
run: |
|
|
go build \
|
|
-ldflags "-s -w -X main.version=${{ steps.version.outputs.VERSION }}" \
|
|
-o "synapbus${{ matrix.suffix }}" \
|
|
./cmd/synapbus/
|
|
|
|
- name: Create archive
|
|
run: |
|
|
ARCHIVE_NAME="synapbus-${{ matrix.goos }}-${{ matrix.goarch }}"
|
|
tar czf "${ARCHIVE_NAME}.tar.gz" synapbus
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: synapbus-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: synapbus-*.tar.gz
|
|
|
|
homebrew:
|
|
name: Generate Homebrew Formula
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
merge-multiple: true
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Calculate checksums and generate formula
|
|
run: |
|
|
DARWIN_AMD64_SHA=$(sha256sum artifacts/synapbus-darwin-amd64.tar.gz | awk '{print $1}')
|
|
DARWIN_ARM64_SHA=$(sha256sum artifacts/synapbus-darwin-arm64.tar.gz | awk '{print $1}')
|
|
LINUX_AMD64_SHA=$(sha256sum artifacts/synapbus-linux-amd64.tar.gz | awk '{print $1}')
|
|
LINUX_ARM64_SHA=$(sha256sum artifacts/synapbus-linux-arm64.tar.gz | awk '{print $1}')
|
|
VERSION="${{ steps.version.outputs.VERSION }}"
|
|
REPO="https://github.com/${{ github.repository }}"
|
|
|
|
cat > synapbus.rb <<FORMULA
|
|
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
class Synapbus < Formula
|
|
desc "Local-first, MCP-native agent-to-agent messaging service"
|
|
homepage "${REPO}"
|
|
version "${VERSION}"
|
|
license "Apache-2.0"
|
|
|
|
on_macos do
|
|
if Hardware::CPU.intel?
|
|
url "${REPO}/releases/download/${GITHUB_REF_NAME}/synapbus-darwin-amd64.tar.gz"
|
|
sha256 "${DARWIN_AMD64_SHA}"
|
|
end
|
|
if Hardware::CPU.arm?
|
|
url "${REPO}/releases/download/${GITHUB_REF_NAME}/synapbus-darwin-arm64.tar.gz"
|
|
sha256 "${DARWIN_ARM64_SHA}"
|
|
end
|
|
end
|
|
|
|
on_linux do
|
|
if Hardware::CPU.intel?
|
|
url "${REPO}/releases/download/${GITHUB_REF_NAME}/synapbus-linux-amd64.tar.gz"
|
|
sha256 "${LINUX_AMD64_SHA}"
|
|
end
|
|
if Hardware::CPU.arm?
|
|
url "${REPO}/releases/download/${GITHUB_REF_NAME}/synapbus-linux-arm64.tar.gz"
|
|
sha256 "${LINUX_ARM64_SHA}"
|
|
end
|
|
end
|
|
|
|
def install
|
|
bin.install "synapbus"
|
|
end
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{bin}/synapbus --version")
|
|
end
|
|
end
|
|
FORMULA
|
|
|
|
# Remove leading whitespace from heredoc
|
|
sed -i 's/^ //' synapbus.rb
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: homebrew-formula
|
|
path: synapbus.rb
|
|
|
|
release:
|
|
name: GitHub Release
|
|
needs: [build, homebrew]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
merge-multiple: true
|
|
|
|
- name: List artifacts
|
|
run: ls -la artifacts/
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/synapbus-*.tar.gz
|
|
artifacts/synapbus.rb
|
|
|
|
docker:
|
|
name: Docker Image
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/synapbus/synapbus
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest
|
|
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
build-args: |
|
|
VERSION=${{ steps.version.outputs.VERSION }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|