Skip to content

Commit 67654e1

Browse files
authored
Merge pull request #41 from twisted/40-fix-pypi-publish
#40 Publish to PyPi using GitHub Actions
2 parents 7339658 + 704ece4 commit 67654e1

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ jobs:
6060

6161
- name: Install dependencies
6262
run: |
63-
openssl version
6463
python -m pip install --upgrade twisted coverage build
6564
66-
- name: Test
65+
- name: Test build on each supported python
66+
run: python -m build .
67+
68+
- name: Test code
6769
run: |
6870
coverage run -m twisted.trial constantly
6971
mv .coverage .coverage.${{ matrix.python-version }}
@@ -75,6 +77,7 @@ jobs:
7577
path: .coverage.*
7678
if-no-files-found: error # 'warn' or 'ignore' are also available.
7779

80+
7881
coverage:
7982
name: Combine & check coverage.
8083
needs: testing
@@ -155,6 +158,10 @@ jobs:
155158
release-publish:
156159
name: Check release and publish on twisted-* tag
157160
runs-on: 'ubuntu-latest'
161+
permissions:
162+
# IMPORTANT: this permission is mandatory for trusted publishing
163+
id-token: write
164+
158165
steps:
159166
- uses: actions/checkout@v3
160167

@@ -163,10 +170,14 @@ jobs:
163170
with:
164171
python-version: '${{ env.DEFAULT_PYTHON_VERSION }}'
165172

173+
- name: Install dependencies
174+
run: |
175+
python -m pip install --upgrade build
176+
166177
- name: Build
167178
run: |
168179
rm -rf dist/*
169-
pipx run --python=python build .
180+
python -m build .
170181
171182
- name: Files to be pushed to PyPi
172183
run: ls -R dist/
@@ -179,7 +190,7 @@ jobs:
179190
180191
- name: Publish to PyPI - on tag
181192
if: startsWith(github.ref, 'refs/tags/')
182-
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598
193+
uses: pypa/gh-action-pypi-publish@release/v1
183194

184195

185196
# We have this job so that the PR can be blocked on a single job.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ versionfile_source = "constantly/_version.py"
4242
versionfile_build = "constantly/_version.py"
4343
tag_prefix = ""
4444
parentdir_prefix = "constantly-"
45+
46+
[bdist_wheel]
47+
universal=0

0 commit comments

Comments
 (0)