Skip to content

Commit ac09e14

Browse files
committed
update to github actions, prepare 4.0.0 release
1 parent 9f34426 commit ac09e14

File tree

2 files changed

+91
-30
lines changed

2 files changed

+91
-30
lines changed

.github/workflows/workflow.yaml

+82-27
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
python-version:
35-
- "3.8"
3635
- "3.9"
3736
- "3.10"
3837
- "3.11"
@@ -47,23 +46,19 @@ jobs:
4746
- mysql
4847
- postgres
4948
exclude:
50-
- python-version: "3.8"
51-
django: "5.0"
52-
- python-version: "3.9"
53-
django: "5.0"
54-
- python-version: "3.8"
55-
django: "5.1"
56-
- python-version: "3.9"
57-
django: "5.1"
58-
- python-version: "3.13"
59-
django: "4.2"
60-
- python-version: "3.13"
61-
django: "5.0"
49+
- django: "4.2"
50+
python-version: "3.13"
51+
- django: "5.0"
52+
python-version: "3.9"
53+
- django: "5.0"
54+
python-version: "3.13"
55+
- django: "5.1"
56+
python-version: "3.9"
6257

6358
services:
6459
# postgres service
6560
postgres:
66-
image: postgres:16-alpine
61+
image: postgres:17-alpine
6762
env:
6863
POSTGRES_USER: postgres
6964
POSTGRES_PASSWORD: postgres
@@ -78,7 +73,7 @@ jobs:
7873
7974
# mysql service
8075
mysql:
81-
image: mysql:8
76+
image: mysql:9
8277
env:
8378
MYSQL_ALLOW_EMPTY_PASSWORD: yes
8479
MYSQL_DATABASE: test
@@ -112,10 +107,10 @@ jobs:
112107
run: pip install "Django>=5.1,<5.2"
113108
- name: Install MySQL libs
114109
if: matrix.database == 'mysql'
115-
run: pip install mysqlclient>=2.2.4 django-mysql>=4.14.0
110+
run: pip install mysqlclient>=2.2.7 django-mysql>=4.16.0
116111
- name: Install postgres libs
117112
if: matrix.database == 'postgres'
118-
run: pip install psycopg==3.1.19
113+
run: pip install psycopg>=3.2.4
119114

120115
- name: Install requirements
121116
run: pip install -r requirements.txt
@@ -146,26 +141,86 @@ jobs:
146141
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
147142
run: coveralls
148143

149-
publish:
150-
name: Build and publish Python 🐍 distributions 📦 to PyPI
151-
needs: test
144+
build:
145+
name: Build package
146+
needs:
147+
- test
152148
runs-on: ubuntu-latest
153149
steps:
154150
- uses: actions/checkout@v4
151+
with:
152+
persist-credentials: false
153+
155154
- name: Set up Python
156155
uses: actions/setup-python@v5
157156
with:
158157
python-version: 3.12
159158

160-
- name: Install deployment packages
161-
run: python -m pip install -U setuptools wheel
159+
- name: Install pypa/build
160+
run: python -m pip install build --user
162161

163162
- name: Build a binary wheel and a source tarball
164-
run: python setup.py sdist bdist_wheel
163+
run: python3 -m build
164+
165+
- name: Store artifacts
166+
uses: actions/upload-artifact@v4
167+
with:
168+
name: python-package-distributions
169+
path: dist/
170+
171+
publish:
172+
name: Publish to PyPI
173+
needs:
174+
- build
175+
runs-on: ubuntu-latest
176+
environment:
177+
name: pypi
178+
url: https://pypi.org/p/django-scrubber
179+
permissions:
180+
id-token: write # IMPORTANT: mandatory for trusted publishing
181+
steps:
182+
- name: Download dists from artifacts
183+
uses: actions/download-artifact@v4
184+
with:
185+
name: python-package-distributions
186+
path: dist/
165187

166-
- name: Publish Package on PyPI
188+
- name: Publish
167189
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
168-
uses: pypa/gh-action-pypi-publish@master
190+
uses: pypa/gh-action-pypi-publish@release/v1
191+
192+
github-release:
193+
name: Sign packages and upload to GitHub releases
194+
needs:
195+
- publish
196+
runs-on: ubuntu-latest
197+
198+
permissions:
199+
contents: write # IMPORTANT: mandatory for making GitHub Releases
200+
id-token: write # IMPORTANT: mandatory for sigstore
201+
202+
steps:
203+
- name: Download dists from artifacts
204+
uses: actions/download-artifact@v4
169205
with:
170-
user: __token__
171-
password: ${{ secrets.PYPI_API_TOKEN }}
206+
name: python-package-distributions
207+
path: dist/
208+
209+
- name: Sign dists
210+
uses: sigstore/[email protected]
211+
with:
212+
inputs: >-
213+
./dist/*.tar.gz
214+
./dist/*.whl
215+
216+
- name: Create GitHub Release
217+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
218+
env:
219+
GITHUB_TOKEN: ${{ github.token }}
220+
run: gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --notes ""
221+
222+
- name: Upload artifact signatures to GitHub release
223+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
224+
env:
225+
GITHUB_TOKEN: ${{ github.token }}
226+
run: gh release upload "$GITHUB_REF_NAME" dist/** --repo "$GITHUB_REPOSITORY"

CHANGELOG.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
<!--
88
## [Unreleased]
9-
- Added Python 3.13 support
9+
### Breaking
10+
- Nothing
11+
### Changed
12+
- Nothing
1013
-->
1114

12-
## [Unreleased]
13-
15+
## [4.0.0] - 2025-02-19
16+
### Breaking
17+
- Removed support for Python 3.8
1418
### Changed
19+
- Added support for Python 3.13 - Thanks @GitRon
20+
- Updates to GitHub actions
1521
- Improved documentation on concatenation of different field types.
1622

1723
## [3.0.0] - 2024-09-10

0 commit comments

Comments
 (0)