Skip to content

Commit 30b4831

Browse files
committed
Release v0.6.0
Signed-off-by: Phillip Sitbon <phillip.sitbon@gmail.com>
2 parents d116235 + 0ccd1fc commit 30b4831

40 files changed

+2302
-303
lines changed

.env.example

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Docker Registry Configuration
22
# REGISTRY=ghcr.io/<your-github-username>
33

4-
# Image source prefix (defaults to $USER)
4+
# Image source prefix for docker compose (defaults to $USER)
55
# SOURCE=local
66

7-
# Config volume path (defaults to named volume 'magg-config' except for dev)
7+
# Config volume path for compose (defaults to named volume 'magg-config' except for dev)
88
# MAGG_CONFIG_VOLUME=./.magg
99

1010
# Authentication
@@ -19,3 +19,10 @@
1919
# Other options
2020
# MAGG_CONFIG_PATH=./magg/config.json
2121
# MAGG_SELF_PREFIX=magg # The prefix used in the MCP server for magg's own tools
22+
23+
# Config reloading
24+
25+
# MAGG_AUTO_RELOAD
26+
# MAGG_RELOAD_POLL_INTERVAL
27+
# MAGG_RELOAD_USE_WATCHDOG
28+
# MAGG_READ_ONLY

.github/workflows/docker-publish.yml

Lines changed: 139 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Docker
22

33
on:
44
push:
5-
branches: [ beta ]
6-
tags: [ 'magg/v*' ]
5+
branches: [ main, beta ]
6+
tags: [ 'v*.*.*' ]
77
pull_request:
88
branches: [ main, beta ]
99
workflow_dispatch:
@@ -13,88 +13,168 @@ env:
1313
IMAGE_NAME: ${{ github.repository }}
1414

1515
jobs:
16-
test-dev-container:
16+
build-dev-image:
17+
name: Build Dev Image
1718
runs-on: ubuntu-latest
19+
1820
permissions:
1921
contents: read
20-
packages: write
21-
22+
2223
strategy:
2324
matrix:
24-
python-version: ['3.12', '3.13']
25+
python-version: [ '3.12', '3.13' ]
2526
fail-fast: false
26-
27+
2728
steps:
2829
- name: Checkout
2930
uses: actions/checkout@v4
30-
31+
3132
- name: Set up Docker Buildx
3233
uses: docker/setup-buildx-action@v3
33-
34+
3435
- name: Log in to Container Registry
3536
uses: docker/login-action@v3
3637
with:
3738
registry: ${{ env.REGISTRY }}
3839
username: ${{ github.actor }}
3940
password: ${{ secrets.GITHUB_TOKEN }}
40-
41-
- name: Extract metadata
42-
id: meta
43-
uses: docker/metadata-action@v5
44-
with:
45-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46-
tags: |
47-
type=ref,event=branch,suffix=-dev-py${{ matrix.python-version }}
48-
type=ref,event=pr,suffix=-dev-py${{ matrix.python-version }}
49-
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}.{{build}},prefix=,suffix=-dev-py${{ matrix.python-version }}
50-
type=raw,value=${{ github.ref_name == 'main' && 'dev' || format('{0}-dev', github.ref_name) }},enable=${{ matrix.python-version == '3.13' && startsWith(github.ref, 'refs/heads/') }}
51-
52-
- name: Build dev image
41+
42+
- name: Build Dev Image
5343
uses: docker/build-push-action@v6
5444
with:
5545
context: .
5646
file: ./dockerfile
5747
target: dev
5848
push: false
59-
tags: ${{ steps.meta.outputs.tags }}
49+
load: true
50+
tags: dev-image:${{ matrix.python-version }}
51+
# tags: ${{ steps.meta.outputs.tags }}
6052
# labels: ${{ steps.meta.outputs.labels }}
6153
build-args: |
6254
PYTHON_VERSION=${{ matrix.python-version }}
6355
cache-from: type=gha
6456
cache-to: type=gha,mode=max
65-
load: true
6657
provenance: false
6758
sbom: false
68-
69-
- name: Run tests in container
59+
60+
- name: Save image as tar
7061
run: |
71-
# Use the first tag only (multiple tags break the docker run command)
72-
FIRST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
73-
docker run --rm \
74-
-e MAGG_LOG_LEVEL= \
75-
${FIRST_TAG} \
76-
pytest -v
77-
78-
- name: Push dev image
79-
if: github.event_name != 'pull_request'
80-
uses: docker/build-push-action@v6
62+
docker save dev-image:${{ matrix.python-version }} -o dev-image-${{ matrix.python-version }}.tar
63+
64+
- name: Upload image artifact
65+
uses: actions/upload-artifact@v4
8166
with:
82-
context: .
83-
file: ./dockerfile
84-
target: dev
85-
push: true
86-
tags: ${{ steps.meta.outputs.tags }}
87-
# labels: ${{ steps.meta.outputs.labels }}
88-
build-args: |
89-
PYTHON_VERSION=${{ matrix.python-version }}
90-
cache-from: type=gha
91-
cache-to: type=gha,mode=max
92-
provenance: false
93-
sbom: false
67+
name: dev-image-${{ matrix.python-version }}
68+
path: dev-image-${{ matrix.python-version }}.tar
69+
70+
test-dev-image:
71+
name: Test Dev Container
72+
runs-on: ubuntu-latest
73+
74+
needs: build-dev-image
75+
if: ${{ !startsWith(github.ref, 'refs/tags/') }} # Only run on branches or PRs, not tags
76+
77+
permissions:
78+
contents: read
79+
80+
strategy:
81+
matrix:
82+
python-version: ['3.12', '3.13']
83+
fail-fast: false
84+
85+
steps:
86+
- name: Download image artifact
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: dev-image-${{ matrix.python-version }}
90+
91+
- name: Load image
92+
run: |
93+
docker load -i dev-image-${{ matrix.python-version }}.tar
94+
95+
- name: Run Container Tests
96+
run: |
97+
docker run --rm -e MAGG_LOG_LEVEL= dev-image:${{ matrix.python-version }} pytest -v
98+
99+
push-dev-image:
100+
name: Push Dev Images
101+
runs-on: ubuntu-latest
102+
103+
needs: [build-dev-image, test-dev-image]
104+
105+
permissions:
106+
contents: read
107+
packages: write
108+
109+
strategy:
110+
matrix:
111+
python-version: ['3.12', '3.13']
112+
fail-fast: false
113+
114+
steps:
115+
- name: Download image artifact
116+
uses: actions/download-artifact@v4
117+
with:
118+
name: dev-image-${{ matrix.python-version }}
119+
120+
- name: Load image
121+
run: |
122+
docker load -i dev-image-${{ matrix.python-version }}.tar
123+
124+
- name: Log in to registry
125+
uses: docker/login-action@v3
126+
with:
127+
registry: ${{ env.REGISTRY }}
128+
username: ${{ github.actor }}
129+
password: ${{ secrets.GITHUB_TOKEN }}
130+
131+
- name: Extract Metadata
132+
id: meta
133+
uses: docker/metadata-action@v5
134+
with:
135+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
136+
tags: |
137+
# pr-NN-dev-py3.XX or pr-NN-dev for 3.13
138+
type=ref,event=pr,suffix=-dev-py${{ matrix.python-version }}
139+
type=ref,event=pr,suffix=-dev,enable=${{ matrix.python-version == '3.13' }}
140+
141+
# branch-dev-py3.XX
142+
type=ref,event=branch,suffix=-dev-py${{ matrix.python-version }}
94143
95-
build-and-push:
96-
needs: test-dev-container
144+
# dev for main branch, only for 3.13
145+
type=raw,value=dev,enable=${{ matrix.python-version == '3.13' && github.ref_name == 'main' }}
146+
147+
# branch-dev for other branches, only for 3.13
148+
type=raw,value=${{ github.ref_name }}-dev,enable=${{ matrix.python-version == '3.13' && github.ref_name != 'main' && startsWith(github.ref, 'refs/heads/') }}
149+
150+
# This matches v1.2.3 and outputs 1.2.3-dev-py3.XX or 1.2.3-dev for 3.13
151+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}},pattern={{major}}.{{minor}}.{{patch}},suffix=-dev-py${{ matrix.python-version }}
152+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}},pattern={{major}}.{{minor}}.{{patch}},suffix=-dev,enable=${{ matrix.python-version == '3.13' }}
153+
154+
# This matches v1.2 and outputs 1.2-dev-py3.XX or 1.2-dev for 3.13
155+
type=semver,pattern=v{{major}}.{{minor}},pattern={{major}}.{{minor}},suffix=-dev-py${{ matrix.python-version }}
156+
type=semver,pattern=v{{major}}.{{minor}},pattern={{major}}.{{minor}},suffix=-dev,enable=${{ matrix.python-version == '3.13' }}
157+
158+
- name: Tag image with all tags
159+
run: |
160+
echo "${{ steps.meta.outputs.tags }}" | while read TAG; do
161+
docker tag dev-image:${{ matrix.python-version }} $TAG
162+
done
163+
shell: bash
164+
165+
- name: Push all tags
166+
run: |
167+
echo "${{ steps.meta.outputs.tags }}" | while read TAG; do
168+
docker push $TAG
169+
done
170+
shell: bash
171+
172+
build-and-push-image:
173+
name: Build and Push Image
97174
runs-on: ubuntu-latest
175+
176+
needs: [build-dev-image, test-dev-image]
177+
98178
permissions:
99179
contents: read
100180
packages: write
@@ -121,15 +201,16 @@ jobs:
121201
username: ${{ github.actor }}
122202
password: ${{ secrets.GITHUB_TOKEN }}
123203

124-
- name: Extract metadata
204+
- name: Extract Metadata
125205
id: meta
126206
uses: docker/metadata-action@v5
127207
with:
128208
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
129209
tags: |
130210
type=ref,event=branch,suffix=${{ matrix.suffix }}
131211
type=ref,event=pr,suffix=${{ matrix.suffix }}
132-
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}.{{build}},prefix=,suffix=${{ matrix.suffix }}
212+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}},pattern={{major}}.{{minor}}.{{patch}},suffix=${{ matrix.suffix }}
213+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}},pattern={{major}}.{{minor}},suffix=${{ matrix.suffix }}
133214
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.target == 'pro' }}
134215
135216
- name: Build and push Docker image
@@ -147,11 +228,15 @@ jobs:
147228
sbom: false
148229

149230
cleanup-untagged:
150-
needs: [test-dev-container, build-and-push]
231+
name: Cleanup Untagged Images
151232
runs-on: ubuntu-latest
152-
if: github.event_name != 'pull_request'
233+
234+
needs: [test-dev-image, build-and-push-image]
235+
if: ${{ github.event_name != 'pull_request' }}
236+
153237
permissions:
154238
packages: write
239+
155240
steps:
156241
- name: Delete untagged images
157242
uses: actions/delete-package-versions@v5

0 commit comments

Comments
 (0)