Skip to content

Commit 38fa75c

Browse files
committed
👷 uv + taskfile
1 parent 4772748 commit 38fa75c

33 files changed

+3732
-15516
lines changed

.github/semantic_release/package-lock.json

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

.github/semantic_release/package.json

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

.github/workflows/lint.yaml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,28 @@ jobs:
88
lint:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Set up Github Workspace
12-
uses: actions/checkout@v4
13-
with:
14-
fetch-depth: 0
15-
- name: Set up Python Environment 3.11
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: "3.11"
19-
- name: Install Hatch
20-
run: |
21-
python -m pip install --upgrade pip
22-
python -m pip install -q hatch
23-
hatch env create
24-
hatch --version
25-
- name: Lint
11+
- name: lint
2612
id: lint
13+
uses: juftin/actions/taskfile@v1
2714
continue-on-error: true
28-
run: |
29-
echo "::add-matcher::.github/workflows/matchers/flake8.json"
30-
hatch run lint:style
31-
echo "::remove-matcher owner=flake8::"
32-
- name: Code Checker
15+
with:
16+
checkout: true
17+
setup-uv: true
18+
task: lint
19+
install: true
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
annotations-ruff: true
22+
- name: check
3323
id: check
24+
uses: juftin/actions/taskfile@v1
3425
continue-on-error: true
35-
run: |
36-
echo "::add-matcher::.github/workflows/matchers/mypy.json"
37-
hatch run lint:typing
38-
echo "::remove-matcher owner=mypy::"
39-
- name: Raise Errors For Linting Failures
26+
with:
27+
task: check
28+
setup-task: false
29+
annotations-mypy: true
30+
- name: Raise Errors For Failures
4031
if: |
41-
steps.lint.outcome != 'success' ||
42-
steps.check.outcome != 'success'
32+
steps.lint.outcome != 'success' || steps.check.outcome != 'success'
4333
run: |
4434
echo "Lint: ${{ steps.lint.outcome }}"
4535
echo "Check: ${{ steps.check.outcome }}"

.github/workflows/matchers/flake8.json

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

.github/workflows/matchers/mypy.json

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

.github/workflows/matchers/python.json

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

.github/workflows/publish.yaml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,18 @@ jobs:
1010
name: PyPI
1111
if: github.repository_owner == 'juftin'
1212
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/browsr
16+
permissions:
17+
id-token: write
1318
steps:
14-
- name: Check out the repository
15-
uses: actions/checkout@v4
19+
- name: build
20+
uses: juftin/actions/taskfile@v1
1621
with:
17-
fetch-depth: 2
18-
- name: Set up Python
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: "3.11"
22-
- name: Install Hatch
23-
run: |
24-
python -m pip install --upgrade pip
25-
python -m pip install -q hatch
26-
hatch env create
27-
hatch --version
28-
- name: Build package
29-
run: |
30-
hatch build
22+
checkout: true
23+
setup-uv: true
24+
task: build
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
3126
- name: Publish package on PyPI
3227
uses: pypa/gh-action-pypi-publish@release/v1
33-
with:
34-
user: __token__
35-
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/release.yaml

Lines changed: 26 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,50 @@
1-
name: Release
1+
name: release
22
on:
33
push:
44
branches: [main, next, beta, alpha, "*.x"]
55
jobs:
66
release:
7-
name: Release
7+
name: release
88
if: github.repository_owner == 'juftin'
99
runs-on: ubuntu-latest
1010
permissions:
1111
contents: write
1212
issues: write
13+
pull-requests: write
1314
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
15+
- name: setup
16+
uses: juftin/actions/taskfile@v1
1617
with:
17-
persist-credentials: false
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v3
20-
- name: Set up Python
21-
uses: actions/setup-python@v5
18+
checkout: true
19+
setup-uv: true
20+
task: run
21+
install: true
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
args: "echo Beginning..."
24+
- name: Semantic Release
25+
uses: juftin/actions/semantic-release@v1
2226
with:
23-
python-version: "3.11"
24-
- name: Install Hatch
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install -q hatch
28-
hatch env create
29-
hatch --version
30-
- name: Release
31-
run: hatch run gen:release
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
34-
GIT_AUTHOR_NAME: github-actions[bot]
35-
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
36-
GIT_COMMITTER_NAME: github-actions[bot]
37-
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
3828

39-
github-pages-publish:
29+
docs:
30+
name: docs
4031
runs-on: ubuntu-latest
41-
needs: release
42-
if: github.ref == 'refs/heads/main' && github.repository_owner == 'juftin'
4332
permissions:
4433
pages: write
4534
id-token: write
4635
environment:
4736
name: github-pages
4837
url: ${{ steps.deployment.outputs.page_url }}
4938
steps:
50-
- name: Checkout Latest Changes
51-
uses: actions/checkout@v4
39+
- name: build-docs
40+
uses: juftin/actions/taskfile@v1
5241
with:
53-
ref: ${{ github.ref }}
54-
fetch-depth: 0
55-
- name: Set up Python Environment
56-
uses: actions/setup-python@v5
57-
with:
58-
python-version: "3.11"
59-
- name: Install Hatch
60-
run: |
61-
python -m pip install --upgrade pip wheel
62-
python -m pip install -q hatch pre-commit
63-
hatch --version
64-
- name: Create Virtual Environment
65-
run: hatch env create docs
66-
- name: Build Site
67-
run: hatch run docs:build
68-
- name: Setup GitHub Pages
69-
uses: actions/configure-pages@v4
70-
- name: Upload Artifact
71-
uses: actions/upload-pages-artifact@v3
72-
with:
73-
path: site/
74-
- name: Deploy to GitHub Pages
42+
checkout: true
43+
setup-uv: true
44+
task: docs
45+
install: true
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
args: build
48+
- name: Publish Docs
49+
uses: juftin/actions/github-pages@v1
7550
id: deployment
76-
uses: actions/deploy-pages@v4

.github/workflows/tests.yaml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,21 @@ jobs:
2727
- { name: Python 3.12, python: "3.12" }
2828
- { name: Python 3.11, python: "3.11" }
2929
- { name: Python 3.10, python: "3.10" }
30+
- { name: Python 3.9, python: "3.9" }
31+
permissions:
32+
contents: read
33+
id-token: write
34+
pull-requests: write
3035
steps:
31-
- name: Set up Github Workspace
32-
uses: actions/checkout@v4
36+
- name: test
37+
uses: juftin/actions/taskfile@v1
3338
with:
34-
fetch-depth: 0
35-
- name: Set up Python Environment ${{ matrix.python }}
36-
uses: actions/setup-python@v5
37-
with:
38-
python-version: ${{ matrix.python }}
39-
- name: Install Hatch
40-
run: |
41-
python -m pip install --upgrade pip
42-
python -m pip install -q hatch
43-
hatch --version
44-
- name: Test Suite
45-
run: |
46-
echo "::add-matcher::.github/workflows/matchers/python.json"
47-
hatch run +py="${{ matrix.python }}" all:cov
48-
echo "::remove-matcher owner=python::"
39+
checkout: true
40+
setup-uv: true
41+
task: test
42+
install: true
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
annotations-pytest: ${{ matrix.python == '3.12' && true || false }}
45+
pytest-coverage: ${{ matrix.python == '3.12' && true || false }}
46+
env:
47+
UV_PYTHON: ${{ matrix.python }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ coverage.xml
5151
.pytest_cache/
5252
cover/
5353
snapshot_report.html
54+
pytest.xml
5455

5556
# Translations
5657
*.mo

0 commit comments

Comments
 (0)