Skip to content

Commit

Permalink
Fix pypi upload (#70)
Browse files Browse the repository at this point in the history
* Update GitHub Actions workflow for publishing and adjust versioning scheme

* Update changelog to include fix for PyPI deployment in version 1.1.b
  • Loading branch information
slyapustin authored Jan 5, 2025
1 parent 13b3235 commit db74f91
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
name: PyPi Release
name: Publish to PyPI

# https://help.github.com/en/actions/reference/events-that-trigger-workflows
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
release:
types:
- created

# based on https://github.com/pypa/gh-action-pypi-publish

jobs:
build:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Check out the code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: "3.x" # Use the latest Python version for publishing

- name: Install dependencies
run: >-
python -m pip install --upgrade setuptools wheel twine
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build
run: >-
- name: Build the package
run: |
python setup.py sdist bdist_wheel
# We do this, since failures on test.pypi aren't that bad
- name: Check the package
run: |
twine check dist/*
- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -43,7 +41,7 @@ jobs:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ django_classified.egg-info/
.DS_Store
venv/
.coverage
.env

5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changelog
=========
v1.1.b (05/01/2025)
-----------------
- Fix Pypi deployemnt


v1.1.0 (05/01/2025)
-----------------
- Added support for Python 3.11-3.13, dropped Python 3.8 support
Expand Down
4 changes: 2 additions & 2 deletions django_classified/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
VERSION = (1, 1, 0)
VERSION = (1, 1, "b")


def get_version():
"""Return the version as a human-format string."""
version = f"{VERSION[0]}.{VERSION[1]}"
# Append 3rd digit if > 0
# Append 3rd symbol if it's not zero
if VERSION[2]:
version = f"{version}.{VERSION[2]}"

Expand Down

0 comments on commit db74f91

Please sign in to comment.