32
32
fail-fast : false
33
33
matrix :
34
34
python-version :
35
- - " 3.8"
36
35
- " 3.9"
37
36
- " 3.10"
38
37
- " 3.11"
@@ -47,23 +46,19 @@ jobs:
47
46
- mysql
48
47
- postgres
49
48
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"
62
57
63
58
services :
64
59
# postgres service
65
60
postgres :
66
- image : postgres:16 -alpine
61
+ image : postgres:17 -alpine
67
62
env :
68
63
POSTGRES_USER : postgres
69
64
POSTGRES_PASSWORD : postgres
78
73
79
74
# mysql service
80
75
mysql :
81
- image : mysql:8
76
+ image : mysql:9
82
77
env :
83
78
MYSQL_ALLOW_EMPTY_PASSWORD : yes
84
79
MYSQL_DATABASE : test
@@ -112,10 +107,10 @@ jobs:
112
107
run : pip install "Django>=5.1,<5.2"
113
108
- name : Install MySQL libs
114
109
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
116
111
- name : Install postgres libs
117
112
if : matrix.database == 'postgres'
118
- run : pip install psycopg==3.1.19
113
+ run : pip install psycopg>=3.2.4
119
114
120
115
- name : Install requirements
121
116
run : pip install -r requirements.txt
@@ -146,26 +141,86 @@ jobs:
146
141
COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
147
142
run : coveralls
148
143
149
- publish :
150
- name : Build and publish Python 🐍 distributions 📦 to PyPI
151
- needs : test
144
+ build :
145
+ name : Build package
146
+ needs :
147
+ - test
152
148
runs-on : ubuntu-latest
153
149
steps :
154
150
- uses : actions/checkout@v4
151
+ with :
152
+ persist-credentials : false
153
+
155
154
- name : Set up Python
156
155
uses : actions/setup-python@v5
157
156
with :
158
157
python-version : 3.12
159
158
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
162
161
163
162
- 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/
165
187
166
- - name : Publish Package on PyPI
188
+ - name : Publish
167
189
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
169
205
with :
170
- user : __token__
171
- password : ${{ secrets.PYPI_API_TOKEN }}
206
+ name : python-package-distributions
207
+ path : dist/
208
+
209
+ - name : Sign dists
210
+
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"
0 commit comments