Skip to content

Commit

Permalink
Add GH workflows to publish to (test)pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
hammady committed Oct 28, 2024
1 parent e73b54a commit a09af82
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to PyPI
on:
push:
tags:
- v*
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/rubydj-pyworker/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build package distributions
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
twine check dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true
32 changes: 32 additions & 0 deletions .github/workflows/publish-testpypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to TestPyPI
on:
push:
branches:
- master
jobs:
testpypi-publish:
name: Upload release to TestPyPI
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/rubydj-pyworker/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build package distributions
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
twine check dist/*
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
print-hash: true
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name = "rubydj-pyworker",
version = '1.1.0',
version = '1.2.0',
description="A pure Python worker for Ruby-based DelayedJobs with Newrelic reporting.",
author="Rayyan Systems, Inc.",
author_email="[email protected]",
Expand Down

0 comments on commit a09af82

Please sign in to comment.