Skip to content

Commit 01b1bf3

Browse files
committed
Update publish to pypi workflow
1 parent bde52ac commit 01b1bf3

2 files changed

Lines changed: 70 additions & 90 deletions

File tree

.github/workflows/publish-package.yml

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

.github/workflows/publish.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
attestations: write
11+
12+
jobs:
13+
build:
14+
name: Build distributions
15+
runs-on: ubuntu-24.04
16+
outputs:
17+
artifact-name: python-package-distributions
18+
steps:
19+
- uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-python@v6
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install build tooling
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install --upgrade build twine pkginfo
31+
32+
- name: Build distributions
33+
run: python -m build
34+
35+
- name: Check distributions
36+
run: python -m twine check dist/*
37+
38+
- name: Verify wheel install
39+
run: |
40+
python -m pip install dist/*.whl
41+
commit-check-mcp --help
42+
43+
- name: Upload distributions
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: python-package-distributions
47+
path: dist/*
48+
49+
- name: Create attestations
50+
uses: actions/attest-build-provenance@v3
51+
with:
52+
subject-path: dist/*
53+
54+
publish:
55+
name: Publish to PyPI
56+
needs: build
57+
runs-on: ubuntu-24.04
58+
environment: pypi
59+
permissions:
60+
contents: read
61+
id-token: write
62+
steps:
63+
- name: Download distributions
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: python-package-distributions
67+
path: dist
68+
69+
- name: Publish to PyPI
70+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)