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+ # GitHub Actions workflow for building and publishing txaio wheels.
2+ #
3+ # This is a simplified version based on the autobahn-python workflow,
4+ # adapted for a pure Python package.
5+ #
6+ name : Build and Publish
7+
8+ on :
9+ push :
10+ branches :
11+ - main
12+ pull_request :
13+ branches :
14+ - main
15+
16+ jobs :
17+ build :
18+ name : Build sdist and wheel
19+ runs-on : ubuntu-latest
20+
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v4
24+
25+ - name : Set up Python
26+ uses : actions/setup-python@v5
27+ with :
28+ python-version : ' 3.11'
29+
30+ - name : Install dependencies
31+ run : pip install build just
32+
33+ - name : Build package
34+ run : just build
35+
36+ - name : Upload distribution package
37+ uses : actions/upload-artifact@v4
38+ with :
39+ name : python-package-distributions
40+ path : dist/
41+
42+ publish-to-pypi :
43+ name : Publish package to PyPI
44+ needs :
45+ - build
46+ runs-on : ubuntu-latest
47+ # Run only when a tag is pushed
48+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
49+
50+ environment :
51+ name : pypi
52+ url : https://pypi.org/p/txaio
53+
54+ permissions :
55+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
56+
57+ steps :
58+ - name : Download distribution package
59+ uses : actions/download-artifact@v4
60+ with :
61+ name : python-package-distributions
62+ path : dist/
63+
64+ - name : Publish package to PyPI
65+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 3434 exec (f .read ()) # defines __version__
3535
3636# Force Python 3+ wheel tag with f-string syntax
37- print (f"Building txaio version { __version__ } " )
37+ print (f"Building txaio version { __version__ } " ) # noqa
3838
3939with open ("README.md" ) as f :
4040 docstr = f .read ()
You can’t perform that action at this time.
0 commit comments