1919jobs :
2020 release :
2121 runs-on : ubuntu-latest
22+ strategy :
23+ matrix :
24+ python-version :
25+ - " 3.12"
2226
2327 steps :
2428 - name : Checkout repository
@@ -27,39 +31,37 @@ jobs:
2731 fetch-depth : 0
2832 ref : ${{ inputs.branch }}
2933
30- - name : Set up Python
31- uses : actions /setup-python@v5
34+ - name : Install uv and set the python version
35+ uses : astral-sh /setup-uv@v6
3236 with :
33- python-version : " 3.12 "
37+ python-version : ${{ matrix.python-version }}
3438
3539 - name : Install dependencies
3640 run : |
37- python -m pip install --upgrade pip
38- pip install towncrier
41+ uv pip install towncrier
3942
4043 - name : Generate draft release notes with Towncrier
4144 run : |
42- towncrier build --draft --version "${{ inputs.version }}" > draft_release_notes.md
45+ uv run towncrier build --draft --version "${{ inputs.version }}" > draft_release_notes.md
4346
4447 - name : Generate final release notes with Towncrier
4548 run : |
4649 if [[ "${{ inputs.prerelease }}" == "false" ]]; then
47- towncrier build --version "${{ inputs.version }}" --yes
50+ uv run towncrier build --version "${{ inputs.version }}" --yes
4851 fi
4952
50- - name : Update pyproject.toml with new version
51- run : |
52- sed -i '/^\[project\]/,/^version = / s/^version = ".*"$/version = "${{ inputs.version }}"/' pyproject.toml
53+ - name : Update pyproject.toml and uv.lock with new version
54+ run : uv version ${{ inputs.version}}
5355
5456 - name : Commit updated changelog
5557 run : |
5658 set -e
5759 git config --global user.name "github-actions[bot]"
58- git config --global user.email "github-actions[bot]@users.noreply.github.com"
59- git add pyproject.toml
60+ git config --global user.email "41898282+ github-actions[bot]@users.noreply.github.com"
61+ git add pyproject.toml uv.lock
6062 git add docs/readthedocs/source/project_details/changelog.rst
6163
62- git commit -m "Update version to ${{ inputs.version }} and generate release notes." || echo "No changes to commit."
64+ git commit -m "Update version to ${{ inputs.version }} and generate release notes."
6365 git push origin ${{ inputs.branch }}
6466
6567 - name : Create tag
7274 with :
7375 tag_name : ${{ inputs.version }}
7476 name : ${{ inputs.version }}
75- draft : true # Set to true to create a draft release.
76- prerelease : " ${{ inputs.prerelease }} == 'true' }}"
77+ draft : true # Set to true to create a draft release.
78+ prerelease : ${{ inputs.prerelease == 'true' }}
7779 body_path : draft_release_notes.md
78- generate_release_notes : true
80+ generate_release_notes : true
0 commit comments