Files
ctfd-mcp/.github/workflows/publish.yml
umbra2728 d89ebcaf64 test: migrate to pytest
Replace unittest-based coverage with pytest and update CI/docs to run the new suite.
2026-02-04 19:34:44 +03:00

67 lines
1.3 KiB
YAML

name: Publish
on:
workflow_dispatch:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches: [main]
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Set up uv
uses: astral-sh/setup-uv@v3
- name: Install project (frozen)
run: uv sync --frozen --no-editable
- name: Run tests
run: uv run pytest
- name: Build distributions
run: uv build --no-sources
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/**
publish:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/p/ctfd-mcp
permissions:
id-token: write
contents: read
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist