File tree Expand file tree Collapse file tree 3 files changed +47
-18
lines changed
Expand file tree Collapse file tree 3 files changed +47
-18
lines changed Original file line number Diff line number Diff line change 1+ # This workflow builds and publishes the package to PyPI when a tag is pushed
2+
3+ name : Publish Python Package
4+
5+ on :
6+ push :
7+ tags :
8+ - ' v*' # Trigger on tags starting with 'v'
9+
10+ jobs :
11+ deploy :
12+ runs-on : ubuntu-latest
13+
14+ # Grant GITHUB_TOKEN the permissions required to create a release
15+ permissions :
16+ contents : read
17+ id-token : write # Required for trusted publishing
18+
19+ steps :
20+ - uses : actions/checkout@v4
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@v5
24+ with :
25+ python-version : ' 3.x' # Use a recent Python version for building
26+
27+ - name : Install build dependencies
28+ run : |
29+ python -m pip install --upgrade pip
30+ pip install build twine
31+
32+ - name : Build package
33+ run : python -m build
34+
35+ - name : Publish package to PyPI
36+ uses : pypa/gh-action-pypi-publish@release/v1
37+ # No API token needed if using trusted publishing
38+ # with:
39+ # password: ${{ secrets.PYPI_API_TOKEN }} # Use an API Token if not using Trusted Publishing
40+
41+ # Optional: Create a GitHub Release
42+ # - name: Create GitHub Release
43+ # uses: softprops/action-gh-release@v1
44+ # with:
45+ # files: dist/*
46+ # env:
47+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments