Skip to content
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dcb8c43
build(flake): use PYTHON_VERSION
drainpixie Sep 2, 2025
0ca6317
style(flake): format forAllSystems
drainpixie Sep 2, 2025
6207e27
ci(test-lint): initialise nixification
drainpixie Sep 2, 2025
92eb57e
ci: testing hooks
drainpixie Sep 2, 2025
3a05cb4
fix: prefer yaml over shell branches
drainpixie Sep 2, 2025
4a23836
chore: bump setup-uv
drainpixie Sep 2, 2025
b4e9a1e
fix: add test group to renderer
drainpixie Sep 2, 2025
f7b506b
ci: restore previous hooks
drainpixie Sep 2, 2025
e015ffc
chore(test-lint): doesn't benefit from cachix
drainpixie Sep 2, 2025
1d10010
Merge branch 'main' into ci/nix
drainpixie Sep 3, 2025
4b54eee
build: add wheel derivation
drainpixie Sep 3, 2025
09c4e43
build: switch to uv2nix
drainpixie Sep 4, 2025
92bb0ac
chore: add output to gitignore and tidy
drainpixie Sep 4, 2025
aeb5193
ci: bump actions/checkout to v5
drainpixie Sep 4, 2025
599beeb
ci: cd-publish action
drainpixie Sep 4, 2025
1c463ee
fix: incorrect workflow syntax
drainpixie Sep 4, 2025
7a0b0b8
fix: incorrect workflow syntax for lint
drainpixie Sep 4, 2025
0fe2242
build: pure devshell
drainpixie Sep 4, 2025
734d6e7
fix: devShell name, hooks packages, enabled groups
drainpixie Sep 4, 2025
2487ef4
ci: readd cachix for lint
drainpixie Sep 4, 2025
4d0472a
ci: get rid of push filter
drainpixie Sep 4, 2025
a39f44d
ci: hardcode cachix instance name
drainpixie Sep 4, 2025
c12f101
fix: yaml is a bad format
drainpixie Sep 4, 2025
a8fd894
ci: incorrect env mapping
drainpixie Sep 4, 2025
cb8c088
ci: bump actions/checkout to v5
drainpixie Sep 4, 2025
d11d964
ci: cachix name is amperser
drainpixie Sep 4, 2025
bf7deaa
ci: make nix build output full error
drainpixie Sep 4, 2025
3cb40b9
fix: set LC_ALL
drainpixie Sep 5, 2025
df3926f
revert: fix: set LC_ALL
drainpixie Sep 5, 2025
a20340a
style: format flake
drainpixie Sep 5, 2025
e770da1
ci: add changelog generation via cliff
drainpixie Sep 5, 2025
4ffa5b4
fix: wrong variable name
drainpixie Sep 5, 2025
09aaada
fix: env not available
drainpixie Sep 5, 2025
2cd6709
fix: wrong action name
drainpixie Sep 5, 2025
302de9d
ci: prefer devshell over cliff action
drainpixie Sep 5, 2025
e1ccb48
refactor: move changelog generation to build step
drainpixie Sep 5, 2025
1e34a84
fix: add depth to checkout
drainpixie Sep 5, 2025
28f21f8
ci: remove useless depth from build step
drainpixie Sep 5, 2025
60467eb
ci: run build on dispatch
drainpixie Sep 8, 2025
d8bbc96
ci: tidy + add workflow inputs & changelog only unreleased
drainpixie Sep 8, 2025
d057f5b
ci: remove changelog commit
drainpixie Sep 8, 2025
1125f26
ci: tagging + version + bump
drainpixie Sep 8, 2025
4bbcd6b
ci: actually install nix in version job
drainpixie Sep 8, 2025
c9fcd03
ci: provenance
drainpixie Sep 8, 2025
5429399
ci: add conditionals for testing
drainpixie Sep 8, 2025
9bd6f8d
ci: publish to pypi
drainpixie Sep 8, 2025
a5b7e84
ci: provenance should be generated on dispatch
drainpixie Sep 8, 2025
0c4582b
ci: cleanup & remove conditionals
drainpixie Sep 8, 2025
bd20928
fix: implement suggestions
drainpixie Sep 9, 2025
5d816e1
ci: also remove token from lint
drainpixie Sep 9, 2025
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
185 changes: 185 additions & 0 deletions .github/workflows/cd-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: "CD: Build & Publish"

on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: true
type: string
prerelease:
description: "Mark as prerelease"
required: false
default: false
type: boolean

jobs:
version:
name: Bump Version & Tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "[INIT] Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Git Config"
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: "[INIT] Install Nix"
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix"
uses: cachix/cachix-action@v15
with:
name: amperser
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}


- name: "[VERSION] Bump & Commit"
run: |
nix develop --command uv version ${{ github.event.inputs.version }}
nix develop --command git-cliff -c cliff.toml \
--tag v${{ github.event.inputs.version }} \
-o CHANGELOG.md

git commit -am "chore: prepare release v${{ github.event.inputs.version }}" || echo "no changes to commit"

- name: "[GIT] Create tag"
run: |
git tag v${{ github.event.inputs.version }}
git push origin HEAD --tags

build:
name: Build Artifacts
runs-on: ubuntu-latest
needs: [version]
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: "[INIT] Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: "[INIT] Install Nix"
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix"
uses: cachix/cachix-action@v15
with:
name: amperser
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: "[BUILD] Wheel"
run: |
mkdir -p dist
nix build -L .#wheel
cp result/*.whl dist/


- name: "[BUILD] Source dist"
run: |
nix build -L .#sdist
cp result/*.tar.gz dist/

- name: "[CHANGELOG] Generate release notes"
run: |
nix develop --command git-cliff -c cliff.toml \
--unreleased --verbose \
-o dist/RELEASE_NOTES.md

- name: "[VERIFY] Provenance"
uses: actions/attest-build-provenance@v3
with:
subject-path: 'dist/*'

- name: "[UPLOAD] Artifacts"
uses: actions/upload-artifact@v4
with:
name: dist-artifacts
path: dist/
if-no-files-found: error

github-release:
name: GitHub Release
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
steps:
- name: "[INIT] Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: "[DOWNLOAD] Artifacts"
uses: actions/download-artifact@v4
with:
name: dist-artifacts
path: dist/

- name: "[INPUT] Get input"
id: input
run: |
echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "prerelease=${{ github.event.inputs.prerelease }}" >> $GITHUB_OUTPUT

- name: "[RELEASE] Create GitHub release"
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.input.outputs.tag }}
tag_name: ${{ steps.input.outputs.tag }}
prerelease: ${{ steps.input.outputs.prerelease }}
body_path: dist/RELEASE_NOTES.md
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pypi-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
permissions:
id-token: write
steps:
- name: "[INIT] Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: "[DOWNLOAD] Artifacts"
uses: actions/download-artifact@v4
with:
name: dist-artifacts
path: dist/

- name: "[INIT] Install Nix"
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix"
uses: cachix/cachix-action@v15
with:
name: amperser
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: "[PUBLISH] PyPI via uv"
run: |
nix develop --command uv publish
24 changes: 0 additions & 24 deletions .github/workflows/cd-pypi.yml

This file was deleted.

72 changes: 53 additions & 19 deletions .github/workflows/ci-lint-test.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,84 @@
name: "CI: Lint & Test"

on: [push, pull_request]

jobs:
lint:
name: Lint
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
runs-on: ubuntu-latest
defaults:
run:
shell: bash

steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v4
- name: "[INIT] Install uv"
uses: astral-sh/setup-uv@v5
uses: actions/checkout@v5

- name: "[INIT] Install Nix"
uses: cachix/install-nix-action@v31
with:
python-version: "3.10"
enable-cache: true
- name: "[INIT] Install dependencies"
run: uv sync --locked --all-extras --dev
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix"
uses: cachix/cachix-action@v15
with:
name: amperser
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: "[EXEC] Lint"
run: uv run poe lint
run: nix develop --command ruff check proselint tests

test-cover:
name: Test & Cover
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
runs-on: ${{ matrix.os }}
permissions:
id-token: write
defaults:
run:
shell: bash
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v4
- name: "[INIT] Install uv"
uses: astral-sh/setup-uv@v5
uses: actions/checkout@v5

- name: "[INIT] Install Nix (Unix)"
if: runner.os != 'Windows'
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix (Unix)"
if: runner.os != 'Windows'
uses: cachix/cachix-action@v15
with:
name: amperser
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: "[INIT] Install uv (Windows)"
if: runner.os == 'Windows'
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
enable-cache: true
- name: "[INIT] Install dependencies"

- name: "[INIT] Install dependencies (Windows)"
if: runner.os == 'Windows'
run: uv sync --locked --all-extras --dev --group test
- name: "[EXEC] Test"

- name: "[EXEC] Test & Coverage (Windows)"
if: runner.os == 'Windows'
run: uv run poe test-cover
env:
PYTHON_VERSION: ${{ matrix.python }}

- name: "[EXEC] Test & Coverage (Unix)"
if: runner.os != 'Windows'
run: nix develop --command uv run poe test-cover
env:
PYTHON_VERSION: ${{ matrix.python }}

- name: "[EXEC] Upload coverage to Codecov"
uses: codecov/codecov-action@v5
with:
Expand Down
45 changes: 29 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# Nix
.direnv/
.envrc
.result/
.pre-commit-config.yaml

# Python
*.egg
*.egg-info
*.pyc
cached_func_calls/*
profile_output
site/write/*
tests/corpus/newyorker/*
cache/*
proselint/cache/*
build/*
*.egg
*.pstore
*.rdb
__pycache__/
build/
dist/
cache/
proselint/cache/
cached_func_calls/*

# Coverage
.coverage
coverage.lcov
proselint/proselint_develop.sublime-project
proselint/proselint_develop.sublime-workspace
profile_output

# Tests
.hypothesis/
tests/corpus/newyorker/*

# Corpora
corpora/*
!corpora/README.md
dist/
*.pstore
.pre-commit-config.yaml
.hypothesis
.direnv/
.envrc

# Editor
proselint/proselint_develop.sublime-workspace
.proselint/proselint_develop.sublime-project
.site/write/*
Loading
Loading