Skip to content

Commit 7368c6c

Browse files
committed
Merge Release v0.5.1
Signed-off-by: Phillip Sitbon <phillip.sitbon@gmail.com>
2 parents c547a7e + 1ea9c57 commit 7368c6c

Some content is hidden

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

67 files changed

+3146
-797
lines changed

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Docker Registry Configuration
2+
# REGISTRY=ghcr.io/<your-github-username>
3+
4+
# Image source prefix (defaults to $USER)
5+
# SOURCE=local
6+
7+
# Config volume path (defaults to named volume 'magg-config' except for dev)
8+
# MAGG_CONFIG_VOLUME=./.magg
9+
10+
# Authentication
11+
# MAGG_PRIVATE_KEY= # generate with `magg auth private-key --oneline`
12+
# MAGG_JWT= # For clients - generate with `magg auth jwt -q`
13+
14+
# Logging
15+
# MAGG_LOG_LEVEL=WARNING
16+
# MAGG_DEBUG=0
17+
# MAGG_QUIET=0
18+
19+
# Other options
20+
# MAGG_CONFIG_PATH=./magg/config.json
21+
# MAGG_SELF_PREFIX=magg # The prefix used in the MCP server for magg's own tools

.github/workflows/README.md

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

.github/workflows/branch-protection.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches: [ beta ]
6+
tags: [ 'magg/v*' ]
7+
pull_request:
8+
branches: [ main, beta ]
9+
workflow_dispatch:
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
test-dev-container:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
strategy:
23+
matrix:
24+
python-version: ['3.12', '3.13']
25+
fail-fast: false
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Log in to Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
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={{version}},suffix=-dev-py${{ matrix.python-version }}
50+
type=semver,pattern={{major}}.{{minor}},suffix=-dev-py${{ matrix.python-version }}
51+
type=raw,value=${{ github.ref == 'refs/heads/main' && 'dev' || format('{0}-dev', github.ref_name) }},enable=${{ matrix.python-version == '3.13' }}
52+
53+
- name: Build dev image
54+
uses: docker/build-push-action@v6
55+
with:
56+
context: .
57+
file: ./dockerfile
58+
target: dev
59+
push: false
60+
tags: ${{ steps.meta.outputs.tags }}
61+
# labels: ${{ steps.meta.outputs.labels }}
62+
build-args: |
63+
PYTHON_VERSION=${{ matrix.python-version }}
64+
cache-from: type=gha
65+
cache-to: type=gha,mode=max
66+
load: true
67+
provenance: false
68+
sbom: false
69+
70+
- name: Run tests in container
71+
run: |
72+
# Use the first tag only (multiple tags break the docker run command)
73+
FIRST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
74+
docker run --rm \
75+
-e MAGG_LOG_LEVEL= \
76+
${FIRST_TAG} \
77+
pytest -v
78+
79+
- name: Push dev image
80+
if: github.event_name != 'pull_request'
81+
uses: docker/build-push-action@v6
82+
with:
83+
context: .
84+
file: ./dockerfile
85+
target: dev
86+
push: true
87+
tags: ${{ steps.meta.outputs.tags }}
88+
# labels: ${{ steps.meta.outputs.labels }}
89+
build-args: |
90+
PYTHON_VERSION=${{ matrix.python-version }}
91+
cache-from: type=gha
92+
cache-to: type=gha,mode=max
93+
provenance: false
94+
sbom: false
95+
96+
build-and-push:
97+
needs: test-dev-container
98+
runs-on: ubuntu-latest
99+
permissions:
100+
contents: read
101+
packages: write
102+
103+
strategy:
104+
matrix:
105+
include:
106+
- target: pre
107+
suffix: "-pre"
108+
- target: pro
109+
suffix: ""
110+
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
115+
- name: Set up Docker Buildx
116+
uses: docker/setup-buildx-action@v3
117+
118+
- name: Log in to Container Registry
119+
uses: docker/login-action@v3
120+
with:
121+
registry: ${{ env.REGISTRY }}
122+
username: ${{ github.actor }}
123+
password: ${{ secrets.GITHUB_TOKEN }}
124+
125+
- name: Extract metadata
126+
id: meta
127+
uses: docker/metadata-action@v5
128+
with:
129+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
130+
tags: |
131+
type=ref,event=branch,suffix=${{ matrix.suffix }}
132+
type=ref,event=pr,suffix=${{ matrix.suffix }}
133+
type=semver,pattern={{version}},suffix=${{ matrix.suffix }}
134+
type=semver,pattern={{major}}.{{minor}},suffix=${{ matrix.suffix }}
135+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.target == 'pro' }}
136+
137+
- name: Build and push Docker image
138+
uses: docker/build-push-action@v6
139+
with:
140+
context: .
141+
file: ./dockerfile
142+
target: ${{ matrix.target }}
143+
push: ${{ github.event_name != 'pull_request' }}
144+
tags: ${{ steps.meta.outputs.tags }}
145+
# labels: ${{ steps.meta.outputs.labels }}
146+
cache-from: type=gha
147+
cache-to: type=gha,mode=max
148+
provenance: false
149+
sbom: false
150+
151+
cleanup-untagged:
152+
needs: [test-dev-container, build-and-push]
153+
runs-on: ubuntu-latest
154+
if: github.event_name != 'pull_request'
155+
permissions:
156+
packages: write
157+
steps:
158+
- name: Delete untagged images
159+
uses: actions/delete-package-versions@v5
160+
with:
161+
package-name: 'magg'
162+
package-type: 'container'
163+
delete-only-untagged-versions: 'true'
164+
min-versions-to-keep: 0
165+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)