Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,494 changes: 0 additions & 12,494 deletions .github/semantic_release/package-lock.json

This file was deleted.

9 changes: 0 additions & 9 deletions .github/semantic_release/package.json

This file was deleted.

44 changes: 17 additions & 27 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,28 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch env create
hatch --version
- name: Lint
- name: lint
id: lint
uses: juftin/actions/taskfile@v1
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
hatch run lint:style
echo "::remove-matcher owner=flake8::"
- name: Code Checker
with:
checkout: true
setup-uv: true
task: lint
install: true
github-token: ${{ secrets.GITHUB_TOKEN }}
annotations-ruff: true
- name: check
id: check
uses: juftin/actions/taskfile@v1
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
hatch run lint:typing
echo "::remove-matcher owner=mypy::"
- name: Raise Errors For Linting Failures
with:
task: check
setup-task: false
annotations-mypy: true
- name: Raise Errors For Failures
if: |
steps.lint.outcome != 'success' ||
steps.check.outcome != 'success'
steps.lint.outcome != 'success' || steps.check.outcome != 'success'
run: |
echo "Lint: ${{ steps.lint.outcome }}"
echo "Check: ${{ steps.check.outcome }}"
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/matchers/flake8.json

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/matchers/mypy.json

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/matchers/python.json

This file was deleted.

30 changes: 11 additions & 19 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,18 @@ jobs:
name: PyPI
if: github.repository_owner == 'juftin'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/browsr
permissions:
id-token: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: build
uses: juftin/actions/taskfile@v1
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch env create
hatch --version
- name: Build package
run: |
hatch build
checkout: true
setup-uv: true
task: build
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
78 changes: 26 additions & 52 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,76 +1,50 @@
name: Release
name: release
on:
push:
branches: [main, next, beta, alpha, "*.x"]
jobs:
release:
name: Release
name: release
if: github.repository_owner == 'juftin'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup
uses: juftin/actions/taskfile@v1
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Set up Python
uses: actions/setup-python@v5
checkout: true
setup-uv: true
task: run
install: true
github-token: ${{ secrets.GITHUB_TOKEN }}
args: "echo Beginning..."
- name: Semantic Release
uses: juftin/actions/semantic-release@v1
with:
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch env create
hatch --version
- name: Release
run: hatch run gen:release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
github_token: ${{ secrets.GITHUB_TOKEN }}

github-pages-publish:
docs:
name: docs
runs-on: ubuntu-latest
needs: release
if: github.ref == 'refs/heads/main' && github.repository_owner == 'juftin'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout Latest Changes
uses: actions/checkout@v4
- name: build-docs
uses: juftin/actions/taskfile@v1
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up Python Environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip wheel
python -m pip install -q hatch pre-commit
hatch --version
- name: Create Virtual Environment
run: hatch env create docs
- name: Build Site
run: hatch run docs:build
- name: Setup GitHub Pages
uses: actions/configure-pages@v4
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/
- name: Deploy to GitHub Pages
checkout: true
setup-uv: true
task: docs
install: true
github-token: ${{ secrets.GITHUB_TOKEN }}
args: build
- name: Publish Docs
uses: juftin/actions/github-pages@v1
id: deployment
uses: actions/deploy-pages@v4
33 changes: 16 additions & 17 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,21 @@ jobs:
- { name: Python 3.12, python: "3.12" }
- { name: Python 3.11, python: "3.11" }
- { name: Python 3.10, python: "3.10" }
- { name: Python 3.9, python: "3.9" }
permissions:
contents: read
id-token: write
pull-requests: write
steps:
- name: Set up Github Workspace
uses: actions/checkout@v4
- name: test
uses: juftin/actions/taskfile@v1
with:
fetch-depth: 0
- name: Set up Python Environment ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch --version
- name: Test Suite
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"
hatch run +py="${{ matrix.python }}" all:cov
echo "::remove-matcher owner=python::"
checkout: true
setup-uv: true
task: test
install: true
github-token: ${{ secrets.GITHUB_TOKEN }}
annotations-pytest: ${{ matrix.python == '3.12' && true || false }}
pytest-coverage: ${{ matrix.python == '3.12' && true || false }}
env:
UV_PYTHON: ${{ matrix.python }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml
.pytest_cache/
cover/
snapshot_report.html
pytest.xml

# Translations
*.mo
Expand Down
49 changes: 28 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
# yaml-language-server: $schema=https://schemastore.org/pre-commit-config.json

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: '\.ambr$'
exclude: tests/__snapshots__/test_screenshots.ambr
- id: end-of-file-fixer
- id: check-yaml
- id: check-ast
- id: check-docstring-first
- id: check-merge-conflict
- id: mixed-line-ending
- id: no-commit-to-branch

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-toml
args: [--autofix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
args: [--print-width=88, --tab-width=4]
exclude: |
(?x)(
docs/|
PULL_REQUEST_TEMPLATE.md|
.github/semantic_release/release_notes.hbs
)
args: [--autofix, --no-sort]

- repo: local
hooks:
- id: format
- id: ruff-format
name: format
description: Runs Code Auto-Formatters
entry: hatch run lint:fmt
entry: uv run ruff format
language: system
pass_filenames: false
- id: lint
types:
- python
- id: ruff-check
name: lint
description: Runs Code Linters
entry: hatch run lint:style
entry: uv run ruff check --fix
language: system
pass_filenames: false
require_serial: false
types:
- python
- id: prettier
name: prettier
description: Runs Prettier Code Formatter
entry: prettier --write --ignore-unknown
args: ["--tab-width=4"]
language: node
types:
- text
additional_dependencies:
- prettier@3.6.2
exclude: |
(?x)(
^docs/|
.github/semantic_release/release_notes.hbs
)
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
Loading
Loading