Skip to content

Commit f5b08e6

Browse files
authored
Update the release workflow (#44)
This PR updates the release workflow to use uv.
1 parent 886e512 commit f5b08e6

5 files changed

Lines changed: 31 additions & 24 deletions

File tree

.github/workflows/on-release.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,20 @@ on:
77

88
jobs:
99
build-and-upload:
10+
name: Build and upload release to PyPI
1011
runs-on: ubuntu-latest
12+
environment: release
13+
permissions:
14+
id-token: write
1115

1216
steps:
1317
- uses: actions/checkout@v5
1418
with:
1519
fetch-depth: 0
16-
- name: Set up Python 3.13
17-
uses: actions/setup-python@v6
20+
- uses: astral-sh/setup-uv@v6
1821
with:
19-
python-version: '3.13'
20-
cache: 'pip'
21-
cache-dependency-path: 'requirements/publish.txt'
22-
- name: Install dependencies
23-
run: python -m pip install -r requirements/publish.txt
24-
- name: Build sdist and wheel
25-
run: python -m build
26-
- name: Publish to PyPI
27-
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30-
run: |
31-
python -m twine check --strict dist/*
32-
python -m twine upload dist/*
22+
version: "0.9.7"
23+
- name: Build package
24+
run: uv build
25+
- name: Publish package
26+
run: uv publish

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Python bytecode
2-
*.pyc
2+
__pycache__/
33

44
# Coverage database
55
.coverage
6-
7-
# Build and distribution
8-
/dist/
9-
/src/*.egg-info/

DEVELOP.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,22 @@ From the root directory of the repository:
1212
- Run `uv run coverage run` to execute the test suite under coverage.
1313
- Run `uvx ruff check` for linting checks.
1414
- Run `uvx ruff format` to format the code.
15+
16+
## Making a release
17+
18+
There's a GitHub Actions workflow that will automatically publish a release to
19+
PyPI when a GitHub release is created.
20+
21+
Steps to make a release:
22+
23+
- Bump the version number in the `pyproject.toml` file if necessary, for example using
24+
`uv version --bump minor` for a minor release. (Note: this also updates the lockfile.)
25+
Make a PR for the version bump.
26+
- Ensure that the lockfile has been updated. (Not necessary if you used `uv version`.)
27+
- Prepare release notes in a (temporary) markdown file.
28+
- Tag the release commit with an annotated tag matching the version (e.g. `git tag -a
29+
2.3.4`); include the prepared release notes in the commit message body.
30+
- Go to the GitHub releases page: https://github.com/mdickinson/simplefractions/releases
31+
- Create a new release, using the previously prepared release notes.
32+
- Double-check that the release workflow succeeded and that the new release is present
33+
on PyPI at https://pypi.org/project/simplefractions.

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 = 'simplefractions'
7-
version = '1.4.0'
7+
version = "1.4.0"
88
description = 'Find the simplest fraction for a given float or interval'
99
readme = 'README.md'
1010
requires-python = '>=3.10'

requirements/publish.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)