-
Notifications
You must be signed in to change notification settings - Fork 8
69 lines (62 loc) · 2.56 KB
/
Copy pathagent-image-relock.yaml
File metadata and controls
69 lines (62 loc) · 2.56 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
# .github/workflows/agent-image-relock.yaml
#
# Regenerates images/hermes-agent/uv.lock for a requested hermes-agent version,
# so contributors don't need a local toolchain to bump the agent image.
#
# Runs pinned uv 0.5.0 (matching the Dockerfile's UV_VERSION, so the lock stays
# compatible with `uv sync --frozen` at image-build time) directly on the runner,
# which has git + a Python interpreter — both required to resolve the
# `hermes-agent @ git+https://...` source dependency. (The astral uv container
# image is distroless: no shell, git, or python, so it cannot resolve git deps.)
#
# Pushes the result to a branch `agent-image-relock-<version>`; open a PR from it
# to main. Once merged, publish via the `agent-image` workflow (or an
# `agent/vX.Y.Z` tag), which verifies the committed lock matches the version.
name: agent-image-relock
on:
workflow_dispatch:
inputs:
hermes_version:
description: "hermes-agent release tag to lock (e.g. v0.16.0)"
required: true
default: "v0.16.0"
type: string
permissions:
contents: write
jobs:
relock:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install uv (pinned, in lockstep with the Dockerfile UV_VERSION)
uses: astral-sh/setup-uv@v7
with:
version: "0.11.7"
- name: Relock uv.lock for the requested hermes-agent version
working-directory: images/hermes-agent
env:
UV_FROZEN: "false" # pyproject sets frozen=true for builds; relock must write
run: |
set -eux
v="${{ inputs.hermes_version }}"
sed -i -E "s|(hermes-agent @ git\+https://github.com/NousResearch/hermes-agent@)[^\"]+|\1${v}|" pyproject.toml
uv lock
- name: Push lockfile branch
run: |
set -eux
v="${{ inputs.hermes_version }}"
br="agent-image-relock-${v}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "${br}"
git add images/hermes-agent/uv.lock images/hermes-agent/pyproject.toml
if git diff --cached --quiet; then
echo "No lockfile changes for ${v} — nothing to push."
exit 0
fi
git commit -m "build(agent-image): lock hermes-agent ${v}"
git push -f origin "${br}"
echo "Pushed branch ${br}. Open a PR to main to enable publishing ghcr.io/paperclipinc/hermes-agent:${v}."