Skip to content

Commit 8b9e0ef

Browse files
authored
Merge pull request #180 from bckohan/v3.x.x
V3.3.0
2 parents 3e312b1 + a0ec1d6 commit 8b9e0ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3092
-243
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions: read-all
55
on:
66
push:
77
pull_request:
8+
workflow_call:
89
workflow_dispatch:
910
inputs:
1011
debug:
@@ -50,10 +51,14 @@ jobs:
5051

5152
- name: Install Just
5253
uses: extractions/setup-just@v2
54+
- name: Install uv
55+
uses: astral-sh/setup-uv@v5
56+
with:
57+
enable-cache: true
5358
- name: Install Dependencies
5459
run: |
55-
just init ${{ steps.sp.outputs.python-path }} install-docs
56-
just pin-dependency Django~=${{ matrix.django-version }}.0
60+
just setup ${{ steps.sp.outputs.python-path }} install-docs
61+
just test-lock Django~=${{ matrix.django-version }}.0
5762
- name: Install Emacs
5863
if: ${{ github.event.inputs.debug == 'true' }}
5964
run: |

.github/workflows/release.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
2+
name: Publish Release
3+
4+
permissions: read-all
5+
6+
concurrency:
7+
# stop previous release runs if tag is recreated
8+
group: release-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
on:
12+
push:
13+
tags:
14+
- 'v*' # only publish on version tags (e.g. v1.0.0)
15+
16+
jobs:
17+
18+
lint:
19+
permissions:
20+
contents: read
21+
actions: write
22+
uses: ./.github/workflows/lint.yml
23+
secrets: inherit
24+
25+
test:
26+
permissions:
27+
contents: read
28+
actions: write
29+
uses: ./.github/workflows/test.yml
30+
secrets: inherit
31+
32+
build:
33+
name: Build Package
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
actions: write
38+
outputs:
39+
PACKAGE_NAME: ${{ steps.set-package.outputs.package_name }}
40+
RELEASE_VERSION: ${{ steps.set-package.outputs.release_version }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: ">=3.11" # for tomlib
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v5
49+
with:
50+
enable-cache: true
51+
- name: Setup Just
52+
uses: extractions/setup-just@v2
53+
- name: Verify Tag
54+
run: |
55+
TAG_NAME=${GITHUB_REF#refs/tags/}
56+
echo "Verifying tag $TAG_NAME..."
57+
# if a tag was deleted and recreated we may have the old one cached
58+
# be sure that we're publishing the current tag!
59+
git fetch --force origin refs/tags/$TAG_NAME:refs/tags/$TAG_NAME
60+
61+
# verify signature
62+
curl -sL https://github.com/${{ github.actor }}.gpg | gpg --import
63+
git tag -v "$TAG_NAME"
64+
65+
# verify version
66+
RELEASE_VERSION=$(just validate_version $TAG_NAME)
67+
68+
# export the release version
69+
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
70+
- name: Build the binary wheel and a source tarball
71+
run: just build
72+
- name: Store the distribution packages
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: python-package-distributions
76+
path: dist/
77+
- name: Set Package Name
78+
id: set-package
79+
run:
80+
PACKAGE_NAME=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['name'])")
81+
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV
82+
83+
publish-to-pypi:
84+
name: Publish to PyPI
85+
needs:
86+
- lint
87+
- test
88+
- build
89+
- publish-to-testpypi
90+
runs-on: ubuntu-latest
91+
environment:
92+
name: pypi
93+
url: https://pypi.org/p/${{ needs.build.outputs.PACKAGE_NAME }}
94+
permissions:
95+
id-token: write # IMPORTANT: mandatory for trusted publishing
96+
steps:
97+
- name: Download all the dists
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: python-package-distributions
101+
path: dist/
102+
- name: Publish distribution 📦 to PyPI
103+
uses: pypa/gh-action-pypi-publish@release/v1.12
104+
105+
github-release:
106+
name: Publish GitHub Release
107+
runs-on: ubuntu-latest
108+
needs:
109+
- lint
110+
- test
111+
- build
112+
permissions:
113+
contents: write # IMPORTANT: mandatory for making GitHub Releases
114+
id-token: write # IMPORTANT: mandatory for sigstore
115+
116+
steps:
117+
- name: Download all the dists
118+
uses: actions/download-artifact@v4
119+
with:
120+
name: python-package-distributions
121+
path: dist/
122+
- name: Sign the dists with Sigstore
123+
uses: sigstore/[email protected]
124+
with:
125+
inputs: >-
126+
./dist/*.tar.gz
127+
./dist/*.whl
128+
- name: Create GitHub Release
129+
env:
130+
GITHUB_TOKEN: ${{ github.token }}
131+
run: >-
132+
gh release create
133+
'${{ github.ref_name }}'
134+
--repo '${{ github.repository }}'
135+
--generate-notes
136+
- name: Upload artifact signatures to GitHub Release
137+
env:
138+
GITHUB_TOKEN: ${{ github.token }}
139+
# Upload to GitHub Release using the `gh` CLI.
140+
# `dist/` contains the built packages, and the
141+
# sigstore-produced signatures and certificates.
142+
run: >-
143+
gh release upload
144+
'${{ github.ref_name }}' dist/**
145+
--repo '${{ github.repository }}'
146+
147+
publish-to-testpypi:
148+
name: Publish to TestPyPI
149+
needs:
150+
- build
151+
runs-on: ubuntu-latest
152+
153+
environment:
154+
name: testpypi
155+
url: https://test.pypi.org/project/${{ needs.build.outputs.PACKAGE_NAME }}
156+
157+
permissions:
158+
id-token: write # IMPORTANT: mandatory for trusted publishing
159+
160+
steps:
161+
- name: Download all the dists
162+
uses: actions/download-artifact@v4
163+
with:
164+
name: python-package-distributions
165+
path: dist/
166+
- name: Publish distribution 📦 to TestPyPI
167+
uses: pypa/gh-action-pypi-publish@release/v1.12
168+
with:
169+
repository-url: https://test.pypi.org/legacy/
170+
skip-existing: true

.github/workflows/scorecard.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: OpenSSF Scorecard
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
push:
9+
branches: [ main ]
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
name: Scorecard analysis
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write
19+
id-token: write
20+
21+
steps:
22+
- name: "Checkout code"
23+
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
26+
27+
- name: "Run analysis"
28+
uses: ossf/[email protected]
29+
with:
30+
results_file: results.sarif
31+
results_format: sarif
32+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
33+
# - you want to enable the Branch-Protection check on a *public* repository, or
34+
# - you are installing Scorecard on a *private* repository
35+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
36+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
37+
38+
# Public repositories:
39+
# - Publish results to OpenSSF REST API for easy access by consumers
40+
# - Allows the repository to include the Scorecard badge.
41+
# - See https://github.com/ossf/scorecard-action#publishing-results.
42+
# For private repositories:
43+
# - `publish_results` will always be set to `false`, regardless
44+
# of the value entered here.
45+
publish_results: true
46+
47+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
48+
# format to the repository Actions tab.
49+
- name: "Upload artifact"
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: SARIF file
53+
path: results.sarif
54+
retention-days: 5
55+
56+
# Upload the results to GitHub's code scanning dashboard (optional).
57+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
58+
- name: "Upload to code-scanning"
59+
uses: github/codeql-action/upload-sarif@v3
60+
with:
61+
sarif_file: results.sarif

.github/workflows/test.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions: read-all
55
on:
66
push:
77
pull_request:
8+
workflow_call:
89
workflow_dispatch:
910
inputs:
1011
debug:
@@ -30,6 +31,7 @@ jobs:
3031
- '4.2' # LTS April 2026
3132
- '5.0' # April 2025
3233
- '5.1' # December 2025
34+
- '5.2b1'
3335
exclude:
3436
- python-version: '3.11'
3537
django-version: '3.2'
@@ -39,6 +41,8 @@ jobs:
3941
django-version: '5.0'
4042
- python-version: '3.9'
4143
django-version: '5.1'
44+
- python-version: '3.9'
45+
django-version: '5.2b1'
4246
- python-version: '3.13'
4347
django-version: '3.2'
4448
- python-version: '3.13'
@@ -63,11 +67,18 @@ jobs:
6367

6468
- name: Setup Just
6569
uses: extractions/setup-just@v2
70+
- name: Install uv
71+
uses: astral-sh/setup-uv@v5
72+
with:
73+
enable-cache: true
6674
- name: Install Release Dependencies
6775
run: |
68-
just init ${{ steps.sp.outputs.python-path }}
69-
just install
70-
just pin-dependency Django~=${{ matrix.django-version }}.0
76+
just setup ${{ steps.sp.outputs.python-path }}
77+
if [ "${{ matrix.django-version }}" = "5.2b1" ]; then
78+
just test-lock "Django==${{ matrix.django-version }}"
79+
else
80+
just test-lock "Django~=${{ matrix.django-version }}.0"
81+
fi
7182
- name: Install Emacs
7283
if: ${{ github.event.inputs.debug == 'true' }}
7384
run: |
@@ -122,11 +133,14 @@ jobs:
122133

123134
- name: Setup Just
124135
uses: extractions/setup-just@v2
136+
- name: Install uv
137+
uses: astral-sh/setup-uv@v5
138+
with:
139+
enable-cache: true
125140
- name: Install Release Dependencies
126141
run: |
127-
just init ${{ steps.sp.outputs.python-path }}
128-
just install
129-
just pin-dependency Django~=${{ matrix.django-version }}.0
142+
just setup ${{ steps.sp.outputs.python-path }}
143+
just test-lock Django~=${{ matrix.django-version }}.0
130144
- name: install-emacs-macos
131145
if: ${{ github.event.inputs.debug == 'true' }}
132146
run: |
@@ -184,11 +198,14 @@ jobs:
184198

185199
- name: Setup Just
186200
uses: extractions/setup-just@v2
201+
- name: Install uv
202+
uses: astral-sh/setup-uv@v5
203+
with:
204+
enable-cache: true
187205
- name: Install Release Dependencies
188206
run: |
189-
just init ${{ steps.sp.outputs.python-path }}
190-
just install
191-
just pin-dependency Django~=${{ matrix.django-version }}.0
207+
just setup ${{ steps.sp.outputs.python-path }}
208+
just test-lock Django~=${{ matrix.django-version }}.0
192209
- name: install-vim-windows
193210
if: ${{ github.event.inputs.debug == 'true' }}
194211
uses: rhysd/action-setup-vim@v1
@@ -222,10 +239,13 @@ jobs:
222239

223240
- name: Setup Just
224241
uses: extractions/setup-just@v2
242+
- name: Install uv
243+
uses: astral-sh/setup-uv@v5
244+
with:
245+
enable-cache: true
225246
- name: Install Release Dependencies
226247
run: |
227-
just init ${{ steps.sp.outputs.python-path }}
228-
just install
248+
just setup ${{ steps.sp.outputs.python-path }}
229249
230250
- name: Get coverage files
231251
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)