Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#40 Publish to PyPi using GitHub Actions #41

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with the automatically updated version here.

Since constantly is not that active, I think is ok to pin to the tag



# 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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so that py2 wheels are not generated

Loading