mirror of
https://github.com/umbra2728/ctfd-mcp.git
synced 2026-02-08 06:18:12 +03:00
67 lines
1.3 KiB
YAML
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 python -m unittest discover -s tests
|
|
|
|
- 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
|