Skip to content

Commit ec40bb7

Browse files
authored
Merge pull request #370 from adamspd/fix-workflow-for-test-release
fix workflow publishing logic and package distribution issues
2 parents af4f9e6 + 5b934f8 commit ec40bb7

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publishing
33
on:
44
push:
55
branches:
6-
- main
6+
- '*'
77
tags:
88
- '*'
99
workflow_dispatch:
@@ -64,7 +64,8 @@ jobs:
6464
path: dist/*
6565

6666
- name: Publish to PyPI
67-
if: needs.prepare-and-check.outputs.publish_to_pypi == 'true'
67+
# Only publish to PyPI on the main branch
68+
if: needs.prepare-and-check.outputs.publish_to_pypi == 'true' && github.ref == 'refs/heads/main'
6869
run: twine upload dist/*
6970
env:
7071
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
@@ -79,7 +80,8 @@ jobs:
7980

8081
create-release:
8182
needs: [prepare-and-check, build-and-publish]
82-
if: needs.prepare-and-check.outputs.publish_to_pypi == 'true'
83+
# Only create GitHub releases for real PyPI publishes AND only on the main branch
84+
if: needs.prepare-and-check.outputs.publish_to_pypi == 'true' && github.ref == 'refs/heads/main'
8385
runs-on: ubuntu-latest
8486
permissions:
8587
id-token: write

appointment/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
__url__ = "https://github.com/adamspd/django-appointment"
77
__package_website__ = "https://django-appt.adamspierredavid.com/"
88
__package_doc_url__ = "https://django-appt-doc.adamspierredavid.com/"
9-
__version__ = "3.9.0"
10-
__test_version__ = True
9+
__version__ = "3.9.1"
10+
__test_version__ = False
File renamed without changes.
File renamed without changes.

appointments/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131

132132
APPOINTMENT_BUFFER_TIME = 0
133133

134-
LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")]
135134
LANGUAGES = (
136135
('en', _('English')),
137136
('fr', _('French')),

check_version.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ def check_package_version(package_name, current_version, github_ref_=None):
2727
publish_to_pypi = False
2828
publish_to_testpypi = False
2929

30-
# Determine if this is a test version based on the GitHub ref or __test_version__
31-
is_test_version = "test" in github_ref_ if github_ref_ else __test_version__
30+
# Determine if this is a test version - prioritize __test_version__ flag
31+
if __test_version__:
32+
is_test_version = True
33+
elif github_ref_ and "test" in github_ref_:
34+
is_test_version = True
35+
else:
36+
is_test_version = False
37+
3238
pypi_url = "https://test.pypi.org/pypi/" if is_test_version else "https://pypi.org/pypi/"
3339

3440
# Check if the current version exists on the respective PyPI repository

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Django==5.1.7
1+
Django==5.2.2
22
Pillow==11.3.0
33
phonenumbers==9.0.12
44
django-phonenumber-field==8.1.0

setup.cfg

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ include_package_data = true
2222
packages = find:
2323
python_requires = >=3.8
2424
install_requires =
25-
Django>=4.2
26-
Pillow==10.4.0
27-
phonenumbers==8.13.42
28-
django-phonenumber-field==8.0.0
29-
babel==2.15.0
30-
colorama~=0.4.6
25+
Django>=4.2,<6.0
26+
Pillow~=10.4
27+
phonenumbers~=8.13
28+
django-phonenumber-field~=8.0
29+
babel~=2.15
30+
colorama~=0.4
31+
icalendar~=6.3.1

0 commit comments

Comments
 (0)