Skip to content

Commit 3606401

Browse files
authored
Merge pull request #234 from codelion/fix-readme
as
2 parents 5eb3dba + 3716970 commit 3606401

File tree

3 files changed

+644
-505
lines changed

3 files changed

+644
-505
lines changed

.github/workflows/release.yml

Lines changed: 135 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,32 @@ jobs:
2828
- name: Publish package distributions to PyPI
2929
uses: pypa/gh-action-pypi-publish@release/v1
3030

31-
docker-publish:
32-
name: Publish Docker image
33-
runs-on: ubuntu-22.04
31+
# AMD64 Docker build job
32+
docker-build-amd64:
33+
name: Build Docker image (AMD64)
34+
runs-on: ubuntu-latest
3435
needs: pypi-publish
3536
permissions:
3637
contents: read
3738
packages: write
39+
outputs:
40+
digest: ${{ steps.build.outputs.digest }}
41+
metadata: ${{ steps.meta.outputs.json }}
3842
steps:
39-
- uses: actions/checkout@v4
40-
41-
# Add aggressive cleanup before any Docker operations
42-
- name: Free disk space
43-
run: |
44-
# Clean Docker
45-
docker system prune -af
46-
docker image prune -af
47-
docker builder prune -af
48-
49-
df -h
50-
51-
- name: Set up QEMU
52-
uses: docker/setup-qemu-action@v3
53-
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
5446
- name: Set up Docker Buildx
5547
uses: docker/setup-buildx-action@v3
56-
with:
57-
driver-opts: |
58-
image=moby/buildkit:buildx-stable-1
59-
network=host
60-
buildkitd-flags: --debug
61-
48+
6249
- name: Log in to GitHub Container Registry
6350
uses: docker/login-action@v3
6451
with:
6552
registry: ghcr.io
6653
username: ${{ github.actor }}
6754
password: ${{ secrets.GITHUB_TOKEN }}
68-
69-
# Extract metadata for Docker image
70-
- name: Extract metadata for Docker
55+
56+
- name: Extract metadata
7157
id: meta
7258
uses: docker/metadata-action@v5
7359
with:
@@ -76,46 +62,142 @@ jobs:
7662
type=semver,pattern={{version}}
7763
type=semver,pattern={{major}}.{{minor}}
7864
type=raw,value=latest
79-
80-
# Build and push Docker image for AMD64
81-
- name: Build and push Docker image AMD64
65+
labels: |
66+
org.opencontainers.image.title=OpenEvolve
67+
org.opencontainers.image.description=Open-source evolutionary coding agent
68+
org.opencontainers.image.vendor=OpenEvolve
69+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
70+
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}#readme
71+
org.opencontainers.image.licenses=Apache-2.0
72+
73+
- name: Build and push AMD64
74+
id: build
8275
uses: docker/build-push-action@v5
8376
with:
8477
context: .
85-
file: Dockerfile
86-
push: true
8778
platforms: linux/amd64
88-
tags: ${{ steps.meta.outputs.tags }}
79+
push: true
80+
tags: ${{ steps.meta.outputs.tags }}-amd64
8981
labels: ${{ steps.meta.outputs.labels }}
9082
cache-from: type=gha,scope=openevolve-amd64
9183
cache-to: type=gha,scope=openevolve-amd64,mode=max
92-
outputs: type=registry,compression=zstd,compression-level=5
84+
provenance: mode=max
85+
sbom: true
9386

94-
# Cleanup after AMD64 build
95-
- name: Cleanup after AMD64 build
96-
run: |
97-
docker system prune -af
98-
docker builder prune -af
99-
df -h
100-
101-
# Build and push Docker image for ARM64
102-
- name: Build and push Docker image ARM64
87+
# ARM64 Docker build job
88+
docker-build-arm64:
89+
name: Build Docker image (ARM64)
90+
runs-on: ubuntu-latest
91+
needs: pypi-publish
92+
permissions:
93+
contents: read
94+
packages: write
95+
outputs:
96+
digest: ${{ steps.build.outputs.digest }}
97+
metadata: ${{ steps.meta.outputs.json }}
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
102+
- name: Set up QEMU
103+
uses: docker/setup-qemu-action@v3
104+
105+
- name: Set up Docker Buildx
106+
uses: docker/setup-buildx-action@v3
107+
108+
- name: Log in to GitHub Container Registry
109+
uses: docker/login-action@v3
110+
with:
111+
registry: ghcr.io
112+
username: ${{ github.actor }}
113+
password: ${{ secrets.GITHUB_TOKEN }}
114+
115+
- name: Extract metadata
116+
id: meta
117+
uses: docker/metadata-action@v5
118+
with:
119+
images: ghcr.io/${{ github.repository }}
120+
tags: |
121+
type=semver,pattern={{version}}
122+
type=semver,pattern={{major}}.{{minor}}
123+
type=raw,value=latest
124+
labels: |
125+
org.opencontainers.image.title=OpenEvolve
126+
org.opencontainers.image.description=Open-source evolutionary coding agent
127+
org.opencontainers.image.vendor=OpenEvolve
128+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
129+
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}#readme
130+
org.opencontainers.image.licenses=Apache-2.0
131+
132+
- name: Build and push ARM64
133+
id: build
103134
uses: docker/build-push-action@v5
104135
with:
105136
context: .
106-
file: Dockerfile
107-
push: true
108137
platforms: linux/arm64
109-
tags: ${{ steps.meta.outputs.tags }}
138+
push: true
139+
tags: ${{ steps.meta.outputs.tags }}-arm64
110140
labels: ${{ steps.meta.outputs.labels }}
111141
cache-from: type=gha,scope=openevolve-arm64
112142
cache-to: type=gha,scope=openevolve-arm64,mode=max
113-
outputs: type=registry,compression=zstd,compression-level=5
143+
provenance: mode=max
144+
sbom: true
145+
146+
# Create multi-platform manifest
147+
docker-manifest:
148+
name: Create multi-platform manifest
149+
runs-on: ubuntu-latest
150+
needs: [docker-build-amd64, docker-build-arm64]
151+
permissions:
152+
contents: read
153+
packages: write
154+
steps:
155+
- name: Log in to GitHub Container Registry
156+
uses: docker/login-action@v3
157+
with:
158+
registry: ghcr.io
159+
username: ${{ github.actor }}
160+
password: ${{ secrets.GITHUB_TOKEN }}
161+
162+
- name: Extract metadata
163+
id: meta
164+
uses: docker/metadata-action@v5
165+
with:
166+
images: ghcr.io/${{ github.repository }}
167+
tags: |
168+
type=semver,pattern={{version}}
169+
type=semver,pattern={{major}}.{{minor}}
170+
type=raw,value=latest
171+
labels: |
172+
org.opencontainers.image.title=OpenEvolve
173+
org.opencontainers.image.description=Open-source evolutionary coding agent
174+
org.opencontainers.image.vendor=OpenEvolve
175+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
176+
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}#readme
177+
org.opencontainers.image.licenses=Apache-2.0
178+
179+
- name: Create and push multi-platform manifests
180+
run: |
181+
# Get the tags from metadata
182+
TAGS="${{ steps.meta.outputs.tags }}"
183+
184+
# Create manifests for each tag
185+
for tag in $TAGS; do
186+
echo "Creating manifest for $tag"
187+
docker manifest create $tag \
188+
${tag}-amd64 \
189+
${tag}-arm64
190+
191+
# Add platform annotations
192+
docker manifest annotate $tag ${tag}-amd64 --os linux --arch amd64
193+
docker manifest annotate $tag ${tag}-arm64 --os linux --arch arm64 --variant v8
194+
195+
# Push the manifest
196+
docker manifest push $tag
197+
done
114198
115-
# Final cleanup
116-
- name: Final cleanup
199+
- name: Clean up platform-specific tags
117200
run: |
118-
docker system prune -af
119-
docker builder prune -af
120-
find /tmp -type f -user $(id -u) -exec rm -f {} + 2>/dev/null || true
121-
df -h
201+
# Note: Platform-specific tags are kept for debugging purposes
202+
# They can be manually cleaned up later if needed
203+
echo "Platform-specific tags retained: -amd64, -arm64 suffixes"

0 commit comments

Comments
 (0)