File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ name : Publish to PyPI / GitHub
3+
4+ on :
5+ push :
6+ tags :
7+ - " v*"
8+
9+ jobs :
10+ build-n-publish :
11+ name : Build and publish to PyPI
12+ runs-on : ubuntu-latest
13+ permissions :
14+ id-token : write # MANDATORY for trusted publishing to PyPI
15+ contents : write # MANDATORY for the Github release action
16+
17+ steps :
18+ - uses : actions/checkout@v6
19+ with :
20+ fetch-depth : 0
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@v6
24+ with :
25+ python-version : " 3.x"
26+
27+ - name : Build source and wheel distributions
28+ run : |
29+ python -m pip install --upgrade pip
30+ python -m pip install --upgrade build twine
31+ python -m build
32+ twine check --strict dist/*
33+
34+ - name : Create Release Notes
35+ uses : actions/github-script@v8
36+ with :
37+ github-token : ${{secrets.GITHUB_TOKEN}}
38+ script : |
39+ await github.request(`POST /repos/${{ github.repository }}/releases`, {
40+ tag_name: "${{ github.ref }}",
41+ generate_release_notes: true
42+ });
43+
44+ - name : Publish distribution to PyPI
45+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments