-
Notifications
You must be signed in to change notification settings - Fork 37
85 lines (75 loc) · 2.6 KB
/
release-mcp.yml
File metadata and controls
85 lines (75 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release prime-mcp-server
on:
push:
branches: [ "main" ]
paths:
- 'packages/prime-mcp-server/**'
- '.github/workflows/release-mcp.yml'
workflow_dispatch:
inputs:
force_release:
description: 'Force release even if tag exists'
required: false
default: 'false'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: version
working-directory: packages/prime-mcp-server
run: |
VERSION=$(grep -E "^__version__\s*=" src/prime_mcp/__init__.py | sed -E 's/__version__\s*=\s*"([^"]+)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Check for existing tag
id: check_tag
run: |
TAG="prime-mcp-server-v${{ steps.version.outputs.version }}"
if git tag -l "$TAG" | grep -q .; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Tag $TAG already exists"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Tag $TAG does not exist"
fi
- name: Set up Python
if: steps.check_tag.outputs.exists != 'true' || inputs.force_release == 'true'
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install uv
if: steps.check_tag.outputs.exists != 'true' || inputs.force_release == 'true'
uses: astral-sh/setup-uv@v4
- name: Build package
if: steps.check_tag.outputs.exists != 'true' || inputs.force_release == 'true'
working-directory: packages/prime-mcp-server
run: |
uv build --out-dir dist
# Install twine for publishing
uv venv
source .venv/bin/activate
uv pip install twine
- name: Create tag
if: steps.check_tag.outputs.exists != 'true'
run: |
TAG="prime-mcp-server-v${{ steps.version.outputs.version }}"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
- name: Publish to PyPI
if: steps.check_tag.outputs.exists != 'true' || inputs.force_release == 'true'
working-directory: packages/prime-mcp-server
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
source .venv/bin/activate
twine upload dist/*