From a09af822294ff96dab73956de6d975ce0f42d854 Mon Sep 17 00:00:00 2001 From: Hossam Hammady Date: Mon, 28 Oct 2024 17:18:21 -0400 Subject: [PATCH] Add GH workflows to publish to (test)pypi --- .github/workflows/publish-pypi.yaml | 30 +++++++++++++++++++++++ .github/workflows/publish-testpypi.yaml | 32 +++++++++++++++++++++++++ setup.py | 2 +- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-pypi.yaml create mode 100644 .github/workflows/publish-testpypi.yaml diff --git a/.github/workflows/publish-pypi.yaml b/.github/workflows/publish-pypi.yaml new file mode 100644 index 0000000..6e2c731 --- /dev/null +++ b/.github/workflows/publish-pypi.yaml @@ -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 diff --git a/.github/workflows/publish-testpypi.yaml b/.github/workflows/publish-testpypi.yaml new file mode 100644 index 0000000..ae8ff58 --- /dev/null +++ b/.github/workflows/publish-testpypi.yaml @@ -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 diff --git a/setup.py b/setup.py index a23377b..565d79f 100644 --- a/setup.py +++ b/setup.py @@ -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="support@rayyan.ai",