Skip to content

Commit 0d9eff1

Browse files
committed
fix(ci): simplify release workflow
Signed-off-by: Jan Pokorný <JenomPokorny@gmail.com>
1 parent b543202 commit 0d9eff1

2 files changed

Lines changed: 19 additions & 83 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,57 +62,57 @@ runs:
6262
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
6363
with:
6464
path: ~/.local/share/mise/installs
65-
key: mise-installs-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('mise.lock') }}
66-
restore-keys: mise-installs-v1-${{ runner.os }}-{{ runner.arch }}-
65+
key: mise-installs-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('mise.lock') }}
66+
restore-keys: mise-installs-v1-${{ runner.os }}-${{ runner.arch }}-
6767
- if: inputs.save_cache != 'true'
6868
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
6969
with:
7070
path: ~/.local/share/mise/installs
71-
key: mise-installs-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('mise.lock') }}
72-
restore-keys: mise-installs-v1-${{ runner.os }}-{{ runner.arch }}-
71+
key: mise-installs-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('mise.lock') }}
72+
restore-keys: mise-installs-v1-${{ runner.os }}-${{ runner.arch }}-
7373

7474
- if: inputs.save_cache == 'true'
7575
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
7676
with:
7777
path: /tmp/.uv-cache
78-
key: uv-cache-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('**/uv.lock') }}
79-
restore-keys: uv-cache-v1-${{ runner.os }}-{{ runner.arch }}-
78+
key: uv-cache-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/uv.lock') }}
79+
restore-keys: uv-cache-v1-${{ runner.os }}-${{ runner.arch }}-
8080
- if: inputs.save_cache != 'true'
8181
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
8282
with:
8383
path: /tmp/.uv-cache
84-
key: uv-cache-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('**/uv.lock') }}
85-
restore-keys: uv-cache-v1-${{ runner.os }}-{{ runner.arch }}-
84+
key: uv-cache-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/uv.lock') }}
85+
restore-keys: uv-cache-v1-${{ runner.os }}-${{ runner.arch }}-
8686

8787
- if: inputs.save_cache == 'true'
8888
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
8989
with:
9090
path: ~/.local/share/pnpm/store
91-
key: pnpm-store-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
92-
restore-keys: pnpm-store-v1-${{ runner.os }}-{{ runner.arch }}-
91+
key: pnpm-store-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
92+
restore-keys: pnpm-store-v1-${{ runner.os }}-${{ runner.arch }}-
9393
- if: inputs.save_cache != 'true'
9494
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
9595
with:
9696
path: ~/.local/share/pnpm/store
97-
key: pnpm-store-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
98-
restore-keys: pnpm-store-v1-${{ runner.os }}-{{ runner.arch }}-
97+
key: pnpm-store-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
98+
restore-keys: pnpm-store-v1-${{ runner.os }}-${{ runner.arch }}-
9999

100100
- if: inputs.save_cache == 'true'
101101
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
102102
with:
103103
path: "./apps/*/.next/cache"
104-
key: nextjs-cache-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('./apps/*/*.js', './apps/*/src/**/*.js', './apps/*/src/**/*.jsx', './apps/*/src/**/*.ts', './apps/*/src/**/*.tsx') }}
104+
key: nextjs-cache-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('./apps/*/*.js', './apps/*/src/**/*.js', './apps/*/src/**/*.jsx', './apps/*/src/**/*.ts', './apps/*/src/**/*.tsx') }}
105105
restore-keys: |
106-
nextjs-cache-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
107-
nextjs-cache-v1-${{ runner.os }}-{{ runner.arch }}-
106+
nextjs-cache-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
107+
nextjs-cache-v1-${{ runner.os }}-${{ runner.arch }}-
108108
- if: inputs.save_cache != 'true'
109109
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
110110
with:
111111
path: "./apps/*/.next/cache"
112-
key: nextjs-cache-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('./apps/*/*.js', './apps/*/src/**/*.js', './apps/*/src/**/*.jsx', './apps/*/src/**/*.ts', './apps/*/src/**/*.tsx') }}
112+
key: nextjs-cache-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('./apps/*/*.js', './apps/*/src/**/*.js', './apps/*/src/**/*.jsx', './apps/*/src/**/*.ts', './apps/*/src/**/*.tsx') }}
113113
restore-keys: |
114-
nextjs-cache-v1-${{ runner.os }}-{{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
115-
nextjs-cache-v1-${{ runner.os }}-{{ runner.arch }}-
114+
nextjs-cache-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
115+
nextjs-cache-v1-${{ runner.os }}-${{ runner.arch }}-
116116
117117
- if: inputs.save_cache == 'true'
118118
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5

.github/workflows/release.yaml

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -11,70 +11,6 @@ permissions:
1111
id-token: write
1212

1313
jobs:
14-
agents:
15-
runs-on: ubuntu-latest
16-
environment: release
17-
strategy:
18-
matrix:
19-
agent:
20-
- chat
21-
- rag
22-
- form
23-
- canvas
24-
steps:
25-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26-
- id: version
27-
run: |
28-
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
29-
echo "latestTag=$([[ ${GITHUB_REF#refs/tags/v} =~ [a-zA-Z] ]] && echo prerelease || echo latest)" >> $GITHUB_OUTPUT
30-
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
31-
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
32-
with:
33-
registry: ghcr.io
34-
username: ${{ github.actor }}
35-
password: ${{ secrets.GITHUB_TOKEN }}
36-
- uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
37-
with:
38-
context: .
39-
file: ./agents/${{ matrix.agent }}/Dockerfile
40-
push: false
41-
load: true
42-
build-args: |
43-
RELEASE_VERSION=${{ github.ref_name }}
44-
tags: tmp-agent-image
45-
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache
46-
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache,mode=max
47-
- id: agent-manifest
48-
run: |
49-
set -e
50-
docker run -d --rm --name=tmp-agent -p 8000:8000 -e HOST=0.0.0.0 -e PORT=8000 tmp-agent-image
51-
success=0
52-
for i in {1..30}; do
53-
echo "Extracting manifest: attempt $i"
54-
response=$(curl http://localhost:8000/.well-known/agent-card.json 2>/dev/null) && success=1 && break
55-
sleep 0.5
56-
done
57-
[[ "$success" == 1 ]] || (echo "Failed to discover agents" && exit 1)
58-
docker kill tmp-agent
59-
AGENT_MANIFEST=$(echo "$response" | base64 -w 0)
60-
echo "content=$AGENT_MANIFEST" >> $GITHUB_OUTPUT
61-
- uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
62-
with:
63-
context: .
64-
file: ./agents/${{ matrix.agent }}/Dockerfile
65-
push: true
66-
platforms: linux/amd64,linux/arm64
67-
build-args: |
68-
RELEASE_VERSION=${{ github.ref_name }}
69-
tags: |
70-
ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:${{ github.sha }}
71-
ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:${{ steps.version.outputs.version }}
72-
ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:${{ steps.version.outputs.latestTag }}
73-
labels: |
74-
kagenti.dev.agent.json=${{ steps.agent-manifest.outputs.content }}
75-
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache
76-
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/agents/${{ matrix.agent }}:cache,mode=max
77-
7814
vm:
7915
environment: release
8016
strategy:
@@ -105,7 +41,7 @@ jobs:
10541
apps/microshift-vm/dist/${{ matrix.arch }}/microshift-vm-${{ matrix.arch }}.incus.tar.gz
10642
10743
adk:
108-
needs: [agents, vm]
44+
needs: [vm]
10945
runs-on: ubuntu-latest
11046
environment: release
11147
env:

0 commit comments

Comments
 (0)