@@ -3,8 +3,6 @@ name: Continuous Integration
33
44on :
55 push :
6- branches :
7- - ' master'
86 pull_request :
97
108jobs :
1412
1513 steps :
1614 - uses : actions/checkout@v4
15+ with :
16+ persist-credentials : false
1717 - name : Set up Python 3.9
1818 uses : actions/setup-python@v5
1919 with :
3030 - name : Run unit tests
3131 run : |
3232 uv run pytest
33+ - name : Build distribution artifacts
34+ run : |
35+ uv build
36+ - name : Store artifacts
37+ uses : actions/upload-artifact@v4
38+ with :
39+ name : python-package-distribution
40+ path : dist/
41+
42+ publish-to-pypi :
43+ name : Publish to PyPI
44+ needs :
45+ - continous-integration
46+
47+ if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
48+
49+ runs-on : ubuntu-latest
50+ environment :
51+ name : pypi
52+ url : https://pypi.org/p/evdevremapkeys
53+ permissions :
54+ id-token : write # IMPORTANT: mandatory for trusted publishing
55+
56+ steps :
57+ - name : Download all the dists
58+ uses : actions/download-artifact@v4
59+ with :
60+ name : python-package-distributions
61+ path : dist/
62+ - name : Publish distribution 📦 to PyPI
63+ uses : pypa/gh-action-pypi-publish@release/v1
64+
65+ publish-to-testpypi :
66+ name : Publish Python 🐍 distribution 📦 to TestPyPI
67+ needs :
68+ - continous-integration
69+
70+ runs-on : ubuntu-latest
71+
72+ environment :
73+ name : testpypi
74+ url : https://test.pypi.org/p/evdevremapkeys
75+
76+ permissions :
77+ id-token : write # IMPORTANT: mandatory for trusted publishing
78+
79+ steps :
80+ - name : Download all the dists
81+ uses : actions/download-artifact@v4
82+ with :
83+ name : python-package-distributions
84+ path : dist/
85+ - name : Publish distribution 📦 to TestPyPI
86+ uses : pypa/gh-action-pypi-publish@release/v1
87+ with :
88+ repository-url : https://test.pypi.org/legacy/
0 commit comments