Skip to content

Commit 50e1adb

Browse files
authored
buid: add publish PyPI & prepare 1.3.0rc1 release (#54)
Changes: - Added a publish to PyPI workflow (using trusted publishers & attestations) - Bumped the project version to v1.3.0rc1
1 parent b59ef79 commit 50e1adb

File tree

6 files changed

+94
-10
lines changed

6 files changed

+94
-10
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types:
5+
- released
6+
- prereleased
7+
8+
workflow_dispatch:
9+
inputs:
10+
pypi_repo:
11+
description: Which PyPI repository to use
12+
required: true
13+
type: choice
14+
options: ["pypi", "testpypi"]
15+
16+
permissions: {}
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-24.04
21+
22+
permissions:
23+
contents: read
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
29+
- name: Setup Python
30+
id: setup-python
31+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
32+
with:
33+
python-version: "3.14"
34+
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
37+
with:
38+
python-version: ${{ steps.setup-python.outputs.python-version }}
39+
version: "0.10.7"
40+
# hash for uv-x86_64-unknown-linux-gnu.tar.gz.sha256
41+
# (from https://github.com/astral-sh/uv/releases)
42+
checksum: "9ac6cee4e379a5abfca06e78a777b26b7ba1f81cb7935b97054d80d85ac00774"
43+
44+
- name: Build source distributions and wheels
45+
run: uv build -o ./dist
46+
47+
- name: Upload Build
48+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
49+
with:
50+
name: "dist"
51+
path: "dist/"
52+
if-no-files-found: error
53+
retention-days: 5
54+
55+
publish:
56+
runs-on: ubuntu-24.04
57+
environment: publish-pypi
58+
59+
needs:
60+
- build
61+
62+
permissions:
63+
id-token: write # Required for PyPI trusted publishing
64+
65+
steps:
66+
- name: Download source distributions and wheels
67+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
68+
with:
69+
name: dist
70+
path: dist
71+
72+
- name: Publish to PyPI
73+
if: >-
74+
github.event_name == 'release'
75+
|| (
76+
github.event_name == 'workflow_dispatch'
77+
&& github.event.inputs.pypi_repo == 'pypi'
78+
)
79+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
80+
81+
- name: Publish to TestPyPI
82+
if: >-
83+
github.event_name == 'workflow_dispatch'
84+
&& github.event.inputs.pypi_repo == 'testpypi'
85+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
86+
with:
87+
repository-url: https://test.pypi.org/legacy/

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
v1.3.0 - Unreleased
2-
+++++++++++++++++++
1+
v1.3.0 - March 1st 2026
2+
+++++++++++++++++++++++
33

44
- Switched project to uv and pyproject.toml
55
- Switched build system from Travis CI to GitHub Actions

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
<a href='https://pypi.python.org/pypi/pytest-django-queries'>
1313
<img src='https://img.shields.io/pypi/v/pytest-django-queries.svg' alt='Version' />
1414
</a>
15-
<a href="https://pypi.org/project/pytest-django-queries/1.2rc1/">
16-
<img src="https://img.shields.io/badge/pypi%20unstable-v1.2rc1-FF0000.svg" alt="Latest Unstable on pypi">
17-
</a>
1815
</p>
1916
<p>
20-
<a href='https://github.com/NyanKiyoshi/pytest-django-queries/compare/v1.2.0...master'>
21-
<img src='https://img.shields.io/github/commits-since/NyanKiyoshi/pytest-django-queries/v1.2.0.svg' alt='Commits since latest release' />
17+
<a href='https://github.com/NyanKiyoshi/pytest-django-queries/compare/v1.3.0rc1...master'>
18+
<img src='https://img.shields.io/github/commits-since/NyanKiyoshi/pytest-django-queries/v1.3.0rc1.svg' alt='Commits since latest release' />
2219
</a>
2320
<a href='https://pypi.python.org/pypi/pytest-django-queries'>
2421
<img src='https://img.shields.io/pypi/pyversions/pytest-django-queries.svg' alt='Supported versions' />

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ addition of in the changelog.
4444
- [ ] Bump the major, minor or patch version number
4545

4646
## Bumping the version
47-
- [ ] Make sure to bump the `setup.py`'s version to the correct newest version.
47+
- [ ] Make sure to bump the version in `pyproject.toml` to the correct newest version.
4848
- [ ] Update the `README.md` file's comparison tag version (look for `Commits since latest release`).
4949
- [ ] Commit with the message "Bump version for new release" and push it to a new branch
5050
- [ ] Prepare the final changelog and notes

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "uv_build"
44

55
[project]
66
name = "pytest-django-queries"
7-
version = "1.2.0"
7+
version = "1.3.0rc1"
88
description = "Generate performance reports from your django database performance tests."
99
readme = "README.md"
1010
license = "MIT"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)