Skip to content

Commit 9708866

Browse files
authored
ci: unify releasing (#890)
* ci: add Lima to Mise Signed-off-by: Jan Pokorný <[email protected]> * refactor(helm): simplify folder structure Signed-off-by: Jan Pokorný <[email protected]> * feat(ci): add version:check and version:bump tasks Signed-off-by: Jan Pokorný <[email protected]> * chore: unify versions Signed-off-by: Jan Pokorný <[email protected]> * chore: remove obsolete releasing docs Signed-off-by: Jan Pokorný <[email protected]> * feat: make agent-registry fixed to current version Signed-off-by: Jan Pokorný <[email protected]> * fix: outputs for beeai-web:build Signed-off-by: Jan Pokorný <[email protected]> * fix: beeai-web build Signed-off-by: Jan Pokorný <[email protected]> * chore: remove unneeded init file Signed-off-by: Jan Pokorný <[email protected]> * ci: update workflows Signed-off-by: Jan Pokorný <[email protected]> * fix: use lima from asdf Signed-off-by: Jan Pokorný <[email protected]> * fix: version check for github ref Signed-off-by: Jan Pokorný <[email protected]> * fix: update task sources Signed-off-by: Jan Pokorný <[email protected]> * fix: do not publish prerelease as latest Signed-off-by: Jan Pokorný <[email protected]> --------- Signed-off-by: Jan Pokorný <[email protected]>
1 parent d21d432 commit 9708866

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1908
-2000
lines changed

.github/workflows/agents.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/beeai-cli.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/beeai-server.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/beeai-web.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/common.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- uses: ./.github/actions/setup
19-
- run: mise run --force setup
20-
- run: mise run --force check
21-
- run: mise run --force test
19+
- run: mise run check
20+
- run: mise run test

.github/workflows/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
id-token: write
12+
13+
jobs:
14+
agents:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
agent:
19+
- official/beeai-framework/chat
20+
- official/sequential-workflow
21+
- community/aider
22+
- community/gpt-researcher
23+
steps:
24+
- uses: actions/checkout@v4
25+
- id: version
26+
run: |
27+
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
28+
echo "latestTag=$([[ ${GITHUB_REF#refs/tags/v} =~ [a-zA-Z] ]] && echo prerelease || echo latest)" >> $GITHUB_OUTPUT
29+
- uses: docker/setup-buildx-action@v3
30+
- uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
- uses: docker/build-push-action@v5
36+
with:
37+
context: ./agents/${{ matrix.agent }}
38+
push: false
39+
load: true
40+
build-args: |
41+
RELEASE_VERSION=${{ github.ref_name }}
42+
tags: tmp-agent-image
43+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.agent }}:cache
44+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.agent }}:cache,mode=max
45+
- id: agent-manifest
46+
run: |
47+
set -e
48+
docker run -d --rm --name=tmp-agent -p 8000:8000 -e HOST=0.0.0.0 tmp-agent-image
49+
success=0
50+
for i in {1..30}; do
51+
echo "Extracting manifest: attempt $i"
52+
response=$(curl http://localhost:8000/agents 2>/dev/null) && success=1 && break
53+
sleep 0.5
54+
done
55+
[[ "$success" == 1 ]] || (echo "Failed to discover agents" && exit 1)
56+
docker kill tmp-agent
57+
AGENT_MANIFEST=$(echo "$response" | base64 -w 0)
58+
echo "content=$AGENT_MANIFEST" >> $GITHUB_OUTPUT
59+
- uses: docker/build-push-action@v5
60+
with:
61+
context: ./agents/${{ matrix.agent }}
62+
push: true
63+
platforms: linux/amd64,linux/arm64
64+
build-args: |
65+
RELEASE_VERSION=${{ github.ref_name }}
66+
tags: |
67+
ghcr.io/${{ github.repository }}/${{ matrix.agent }}:${{ github.sha }}
68+
ghcr.io/${{ github.repository }}/${{ matrix.agent }}:${{ steps.version.outputs.version }}
69+
ghcr.io/${{ github.repository }}/${{ matrix.agent }}:${{ steps.version.outputs.latestTag }}
70+
labels: |
71+
beeai.dev.agent.yaml=${{ steps.agent-manifest.outputs.content }}
72+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.agent }}:cache
73+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/${{ matrix.agent }}:cache,mode=max
74+
75+
beeai-platform:
76+
needs: agents
77+
runs-on: ubuntu-latest
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
HELM_EXPERIMENTAL_OCI: '1'
81+
steps:
82+
- uses: actions/checkout@v4
83+
- id: version
84+
run: |
85+
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
86+
echo "latestTag=$([[ ${GITHUB_REF#refs/tags/v} =~ [a-zA-Z] ]] && echo prerelease || echo latest)" >> $GITHUB_OUTPUT
87+
- uses: ./.github/actions/setup
88+
- run: mise run version:check
89+
- uses: docker/setup-qemu-action@v3
90+
- uses: docker/setup-buildx-action@v3
91+
- uses: docker/login-action@v3
92+
with:
93+
registry: ghcr.io
94+
username: ${{ github.actor }}
95+
password: ${{ secrets.GITHUB_TOKEN }}
96+
97+
- run: mise run beeai-server:build
98+
- uses: docker/build-push-action@v6
99+
with:
100+
context: ./apps/beeai-server
101+
push: true
102+
platforms: linux/amd64,linux/arm64
103+
tags: |
104+
ghcr.io/${{ github.repository }}/beeai-server:${{ github.sha }}
105+
ghcr.io/${{ github.repository }}/beeai-server:${{ steps.version.outputs.version }}
106+
ghcr.io/${{ github.repository }}/beeai-server:${{ steps.version.outputs.latestTag }}
107+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/beeai-server:cache
108+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/beeai-server:cache,mode=max
109+
110+
- run: mise run helm:build
111+
- run: echo '${{ secrets.GITHUB_TOKEN }}' | helm registry login --username '${{ github.actor }}' --password-stdin ghcr.io
112+
- run: helm push dist/beeai-platform-*.tgz 'oci://ghcr.io/${{ github.repository }}/beeai-platform-chart'
113+
114+
- run: mise run beeai-cli:build
115+
- uses: pypa/gh-action-pypi-publish@release/v1
116+
with:
117+
packages-dir: apps/beeai-cli/dist

0 commit comments

Comments
 (0)