-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (90 loc) · 2.91 KB
/
release.yml
File metadata and controls
102 lines (90 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: "Release"
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. 1.1.0)"
required: true
type: string
env:
RELEASE_NAME: "AI Agent Testing Environment"
jobs:
validate-tag:
name: "Validate release tag"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check semver tag format
run: |
TAG="${{ github.ref_name }}"
if ! echo "$TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "::error::Invalid tag format: $TAG. Tags MUST follow semver: v<MAJOR>.<MINOR>.<PATCH> (e.g. v1.1.0)"
exit 1
fi
echo "Tag $TAG is valid semver"
- name: Check VERSION file matches tag
run: |
if [ ! -f VERSION ]; then
echo "::error::VERSION file missing. Create a VERSION file with the version number (e.g. 1.1.0)"
exit 1
fi
VERSION_FILE="v$(cat VERSION)"
TAG="${{ github.ref_name }}"
if [ "$VERSION_FILE" != "$TAG" ]; then
echo "::error::VERSION file ($VERSION_FILE) does not match tag ($TAG). Update VERSION file before releasing."
exit 1
fi
echo "VERSION file ($VERSION_FILE) matches tag ($TAG)"
- name: Check CHANGELOG entry exists
run: |
VERSION="${{ github.ref_name }}"
VERSION_NUM="${VERSION#v}"
if ! grep -q "## \[$VERSION_NUM\]" CHANGELOG.md; then
echo "::error::No CHANGELOG entry found for version $VERSION_NUM. Add a CHANGELOG entry before releasing."
exit 1
fi
echo "CHANGELOG entry found for $VERSION_NUM"
build-and-push:
name: "Build and push ${{ matrix.framework }}"
needs: validate-tag
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
framework:
- opencode
- claude-code
- codex-cli
- gemini-cli
- continue
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- 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: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/agent-test-env-${{ matrix.framework }}
tags: |
type=ref,event=tag
type=raw,value=latest
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./frameworks/${{ matrix.framework }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64