Skip to content

Release

Release #15

Workflow file for this run

name: Release
on:
push:
branches: [main]
paths: [VERSION]
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
preflight:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Read version
id: version
run: echo "version=$(cat VERSION | tr -d '[:space:]')" >> "$GITHUB_OUTPUT"
- name: Check tag does not exist
run: |
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "::error::Tag v${{ steps.version.outputs.version }} already exists"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: go test -race ./...
build:
needs: preflight
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build sidecar binary
run: CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -trimpath -o bin/sidecar-linux ./cmd/sidecar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push API image
uses: docker/build-push-action@v6
with:
context: .
file: build/api/Dockerfile
platforms: linux/${{ matrix.arch }}
push: true
provenance: false
tags: |
ghcr.io/${{ github.repository }}:${{ needs.preflight.outputs.version }}-${{ matrix.arch }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
cache-from: type=gha,scope=${{ matrix.arch }}-api
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}-api
- name: Prepare agent build contexts
run: |
cp bin/sidecar-linux build/agent/sidecar-${{ matrix.arch }}
cp bin/sidecar-linux build/opencode-agent/sidecar-${{ matrix.arch }}
- name: Build and push Agent image
uses: docker/build-push-action@v6
with:
context: build/agent
file: build/agent/Dockerfile
platforms: linux/${{ matrix.arch }}
push: true
provenance: false
tags: |
ghcr.io/helmcode/agent_crew_agent:${{ needs.preflight.outputs.version }}-${{ matrix.arch }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
cache-from: type=gha,scope=${{ matrix.arch }}-agent
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}-agent
- name: Build and push OpenCode Agent image
uses: docker/build-push-action@v6
with:
context: build/opencode-agent
file: build/opencode-agent/Dockerfile
platforms: linux/${{ matrix.arch }}
push: true
provenance: false
tags: |
ghcr.io/helmcode/agent_crew_opencode_agent:${{ needs.preflight.outputs.version }}-${{ matrix.arch }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
cache-from: type=gha,scope=${{ matrix.arch }}-opencode
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}-opencode
manifest:
needs: [build, preflight]
runs-on: ubuntu-latest
steps:
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create API multi-arch manifest
run: |
docker buildx imagetools create \
-t ghcr.io/${{ github.repository }}:${{ needs.preflight.outputs.version }} \
-t ghcr.io/${{ github.repository }}:latest \
ghcr.io/${{ github.repository }}:${{ needs.preflight.outputs.version }}-amd64 \
ghcr.io/${{ github.repository }}:${{ needs.preflight.outputs.version }}-arm64
- name: Create Agent multi-arch manifest
run: |
docker buildx imagetools create \
-t ghcr.io/helmcode/agent_crew_agent:${{ needs.preflight.outputs.version }} \
-t ghcr.io/helmcode/agent_crew_agent:latest \
ghcr.io/helmcode/agent_crew_agent:${{ needs.preflight.outputs.version }}-amd64 \
ghcr.io/helmcode/agent_crew_agent:${{ needs.preflight.outputs.version }}-arm64
- name: Create OpenCode Agent multi-arch manifest
run: |
docker buildx imagetools create \
-t ghcr.io/helmcode/agent_crew_opencode_agent:${{ needs.preflight.outputs.version }} \
-t ghcr.io/helmcode/agent_crew_opencode_agent:latest \
ghcr.io/helmcode/agent_crew_opencode_agent:${{ needs.preflight.outputs.version }}-amd64 \
ghcr.io/helmcode/agent_crew_opencode_agent:${{ needs.preflight.outputs.version }}-arm64
release:
needs: [manifest, preflight]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create git tag
run: |
git tag "v${{ needs.preflight.outputs.version }}"
git push origin "v${{ needs.preflight.outputs.version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.preflight.outputs.version }}
name: v${{ needs.preflight.outputs.version }}
generate_release_notes: true