File tree Expand file tree Collapse file tree 5 files changed +47
-36
lines changed
Expand file tree Collapse file tree 5 files changed +47
-36
lines changed Original file line number Diff line number Diff line change 1- name : Cleanup caches by a branch
1+ name : Cleanup caches
22on :
33 pull_request :
44 types :
Original file line number Diff line number Diff line change 1- # For most projects, this workflow file will not need changing; you simply need
2- # to commit it to your repository.
3- #
4- # You may wish to alter this file to override the set of languages analyzed,
5- # or to provide custom queries or build logic.
6- #
7- # ******** NOTE ********
8- # We have attempted to detect the languages in your repository. Please check
9- # the `language` matrix defined below to confirm you have the correct set of
10- # supported CodeQL languages.
11- #
12- name : " CodeQL Advanced"
1+ name : " CodeQL"
132
143on :
154 workflow_dispatch :
165
176jobs :
187 analyze :
198 name : Analyze (${{ matrix.language }})
20- # Runner size impacts CodeQL analysis time. To learn more, please see:
21- # - https://gh.io/recommended-hardware-resources-for-running-codeql
22- # - https://gh.io/supported-runners-and-hardware-resources
23- # - https://gh.io/using-larger-runners (GitHub.com only)
24- # Consider using larger runners or machines with greater resources for possible analysis time improvements.
259 runs-on : ' ubuntu-latest'
2610 permissions :
2711 # required for all workflows
Original file line number Diff line number Diff line change 1- name : Docs
1+ name : Update docs
22
33on :
44 pull_request :
55 types : [opened, synchronize, reopened]
66 push :
7- branches :
8- - main
7+ tags :
8+ - ' v*.*.* '
99 workflow_dispatch :
10+ inputs :
11+ upload :
12+ description : ' Update documentation'
13+ required : false
14+ type : boolean
15+ default : false
1016
1117jobs :
1218 build :
@@ -17,12 +23,16 @@ jobs:
1723 - name : Checkout code
1824 uses : actions/checkout@v4
1925
20- - name : Setup and Cache Python Poetry
21- uses : packetcoders/action- setup-cache-python-poetry@v1.2.0
26+ - name : Install uv
27+ uses : astral-sh/ setup-uv@v6
2228 with :
23- python-version : " 3.13"
24- poetry-version : " 2.1.2"
25- install-args : --with docs
29+ enable-cache : true
30+ cache-dependency-glob : " uv.lock"
31+ version : " latest"
32+ python-version : ${{ matrix.python-version }}
33+
34+ - name : Install the project
35+ run : uv sync --group docs
2636
2737 - name : Set git credentials
2838 run : |
@@ -31,10 +41,10 @@ jobs:
3141
3242 - name : Build the docs
3343 id : build
34- run : poetry run mkdocs build
44+ run : uv run mkdocs build
3545
3646 - name : Upload docs
37- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
47+ if : ${{ ( github.event.inputs.upload || github.ref_type == 'tag') }}
3848 id : deployment
3949 uses : actions/upload-pages-artifact@v3
4050 with :
4454 name : Deploy the docs
4555 runs-on : ubuntu-latest
4656 needs : build
47- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
57+ if : ${{ ( github.event.inputs.upload || github.ref_type == 'tag') }}
4858
4959 permissions :
5060 contents : read
Original file line number Diff line number Diff line change @@ -29,19 +29,27 @@ jobs:
2929 - name : Checkout code
3030 uses : actions/checkout@v4
3131
32- - name : Setup and Cache Python Poetry
33- uses : packetcoders/action- setup-cache-python-poetry@v1.2.0
32+ - name : Install uv
33+ uses : astral-sh/ setup-uv@v6
3434 with :
35- python-version : " 3.13"
36- poetry-version : " 2.1.2"
35+ enable-cache : true
36+ cache-dependency-glob : " uv.lock"
37+ version : " latest"
38+
39+ - name : Install the project
40+ run : uv sync --no-group docs --no-group dev
3741
3842 - name : Test code
39- run : poetry run pytest
43+ id : test
44+ run : uv run pytest
4045
4146 - name : Package project
42- run : poetry build
47+ id : build
48+ run : uv build -o dist/
4349
4450 - name : Sign build artifacts
51+ id : sign
52+ if : ${{ (github.event.inputs.upload || github.ref_type == 'tag') }}
4553 uses : actions/attest-build-provenance@v2
4654 with :
4755 subject-path : " dist/*"
5563 dist/*
5664
5765 - name : Upload build artifacts
66+ id : upload
5867 uses : actions/upload-artifact@v4
5968 with :
6069 name : release-dists
@@ -66,19 +75,24 @@ jobs:
6675 name : Publish to PyPI
6776 runs-on : ubuntu-latest
6877 needs : release-build
78+ if : ${{ (github.event.inputs.upload || github.ref_type == 'tag') }}
6979
7080 permissions :
71- contents : read
7281 id-token : write
7382
83+ environment :
84+ name : pypi
85+
7486 steps :
7587 - name : Retrieve release distributions
88+ id : download
7689 uses : actions/download-artifact@v4
7790 with :
7891 name : release-dists
7992 path : dist/
8093
8194 - name : Publish package distributions to PyPI
95+ id : publish
8296 uses : pypa/gh-action-pypi-publish@release/v1
8397 with :
8498 attestations : true
Original file line number Diff line number Diff line change 3232 version : " latest"
3333 python-version : ${{ matrix.python-version }}
3434
35+ - name : Install the project
36+ run : uv sync --all-extras --group dev --no-group docs
37+
3538 - name : Lint with ruff
3639 id : lint
3740 if : matrix.python-version == '3.13'
You can’t perform that action at this time.
0 commit comments