Skip to content

Commit db74f91

Browse files
authored
Fix pypi upload (#70)
* Update GitHub Actions workflow for publishing and adjust versioning scheme * Update changelog to include fix for PyPI deployment in version 1.1.b
1 parent 13b3235 commit db74f91

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

.github/workflows/pypi.yml

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1-
name: PyPi Release
1+
name: Publish to PyPI
22

3-
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
43
on:
5-
# Trigger the workflow on push or pull request,
6-
# but only for the master branch
74
push:
85
branches:
96
- master
107
release:
118
types:
129
- created
1310

14-
# based on https://github.com/pypa/gh-action-pypi-publish
15-
1611
jobs:
17-
build:
12+
publish:
1813
runs-on: ubuntu-latest
19-
strategy:
20-
matrix:
21-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2214

2315
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions/setup-python@v2
16+
- name: Check out the code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
2621
with:
27-
python-version: ${{ matrix.python-version }}
22+
python-version: "3.x" # Use the latest Python version for publishing
2823

2924
- name: Install dependencies
30-
run: >-
31-
python -m pip install --upgrade setuptools wheel twine
25+
run: |
26+
python -m pip install --upgrade pip setuptools wheel twine
3227
33-
- name: Build
34-
run: >-
28+
- name: Build the package
29+
run: |
3530
python setup.py sdist bdist_wheel
3631
37-
# We do this, since failures on test.pypi aren't that bad
32+
- name: Check the package
33+
run: |
34+
twine check dist/*
35+
3836
- name: Publish to Test PyPI
3937
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
4038
uses: pypa/gh-action-pypi-publish@release/v1
@@ -43,7 +41,7 @@ jobs:
4341
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
4442
repository-url: https://test.pypi.org/legacy/
4543

46-
- name: Publish distribution 📦 to PyPI
44+
- name: Publish to PyPI
4745
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
4846
uses: pypa/gh-action-pypi-publish@release/v1
4947
with:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ django_classified.egg-info/
88
.DS_Store
99
venv/
1010
.coverage
11+
.env
12+

changelog.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Changelog
22
=========
3+
v1.1.b (05/01/2025)
4+
-----------------
5+
- Fix Pypi deployemnt
6+
7+
38
v1.1.0 (05/01/2025)
49
-----------------
510
- Added support for Python 3.11-3.13, dropped Python 3.8 support

django_classified/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
VERSION = (1, 1, 0)
1+
VERSION = (1, 1, "b")
22

33

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

0 commit comments

Comments
 (0)