Skip to content

Commit

Permalink
Merge pull request #41 from twisted/40-fix-pypi-publish
Browse files Browse the repository at this point in the history
#40 Publish to PyPi using GitHub Actions
  • Loading branch information
twm authored Jul 30, 2024
2 parents 7339658 + 704ece4 commit 67654e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ jobs:

- name: Install dependencies
run: |
openssl version
python -m pip install --upgrade twisted coverage build
- name: Test
- name: Test build on each supported python
run: python -m build .

- name: Test code
run: |
coverage run -m twisted.trial constantly
mv .coverage .coverage.${{ matrix.python-version }}
Expand All @@ -75,6 +77,7 @@ jobs:
path: .coverage.*
if-no-files-found: error # 'warn' or 'ignore' are also available.


coverage:
name: Combine & check coverage.
needs: testing
Expand Down Expand Up @@ -155,6 +158,10 @@ jobs:
release-publish:
name: Check release and publish on twisted-* tag
runs-on: 'ubuntu-latest'
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade build
- name: Build
run: |
rm -rf dist/*
pipx run --python=python build .
python -m build .
- name: Files to be pushed to PyPi
run: ls -R dist/
Expand All @@ -179,7 +190,7 @@ jobs:
- name: Publish to PyPI - on tag
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598
uses: pypa/gh-action-pypi-publish@release/v1


# We have this job so that the PR can be blocked on a single job.
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ versionfile_source = "constantly/_version.py"
versionfile_build = "constantly/_version.py"
tag_prefix = ""
parentdir_prefix = "constantly-"

[bdist_wheel]
universal=0

0 comments on commit 67654e1

Please sign in to comment.