Files
woggioni 5db454f8c8 build: derive package version from git via setuptools-scm
Replace hatchling and the static version with setuptools + setuptools-scm,
following Kaya's pre-uv packaging setup: dynamic version, generated
_version.py, and release/* tag prefix. The Docker builder now includes git
and the .git directory so the image is versioned from the checkout. CI
checks out full history and tags for the tag-triggered builds.
2026-10-22 04:03:08 +00:00

45 lines
1.3 KiB
YAML

name: CI
on:
push:
tags:
- 'release/*'
jobs:
build_and_push_docker_image:
name: "Build and push docker image"
runs-on: hostinger
steps:
- name: Checkout sources
uses: actions/checkout@v6
with:
# setuptools-scm needs tags and history to derive the package version.
fetch-depth: 0
fetch-tags: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea container registry
uses: docker/login-action@v3
with:
registry: gitea.woggioni.net
username: woggioni-opencode-agent
password: ${{ secrets.PUBLISHER_TOKEN }}
- name: Extract metadata for image tags
id: meta
uses: docker/metadata-action@v5
with:
images: gitea.woggioni.net/woggioni/xmcp
flavor: latest=false
tags: |
type=match,pattern=release/(.*),group=1
type=raw,value=latest
- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: .
builder: multiplatform-builder
file: Dockerfile
platforms: linux/amd64
push: true
pull: true
tags: ${{ steps.meta.outputs.tags }}