pydantic model generator for atproto lexicons
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: use maturin-action for proper wheel building

- replace custom publish.yml with maturin generate-ci output
- add version-from-tag step to all build jobs
- use trusted publishing (no API token needed)
- build manylinux/musllinux/windows/macos wheels

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

zzstoatzz 542c0f92 1cb01fc6

+250 -88
+249 -53
.github/workflows/ci.yml
··· 1 + # This file is autogenerated by maturin v1.10.2 2 + # To update, run 3 + # 4 + # maturin generate-ci github --pytest -o .github/workflows/ci.yml 5 + # 1 6 name: CI 2 7 3 8 on: 4 - pull_request: 5 - paths: 6 - - "src/**" 7 - - "tests/**" 8 - - "pyproject.toml" 9 - - "uv.lock" 10 - - ".pre-commit-config.yaml" 11 - - ".github/workflows/ci.yml" 12 9 push: 13 - branches: [main] 14 - paths: 15 - - "src/**" 16 - - "tests/**" 17 - - "pyproject.toml" 18 - - "uv.lock" 19 - - ".pre-commit-config.yaml" 20 - - ".github/workflows/ci.yml" 10 + branches: 11 + - main 12 + - master 13 + tags: 14 + - '*' 15 + pull_request: 16 + workflow_dispatch: 21 17 22 18 permissions: 23 19 contents: read 24 20 25 21 jobs: 26 - pre-commit: 27 - timeout-minutes: 5 28 - runs-on: ubuntu-latest 22 + linux: 23 + runs-on: ${{ matrix.platform.runner }} 24 + strategy: 25 + matrix: 26 + platform: 27 + - runner: ubuntu-22.04 28 + target: x86_64 29 + - runner: ubuntu-22.04 30 + target: x86 31 + - runner: ubuntu-22.04 32 + target: aarch64 33 + - runner: ubuntu-22.04 34 + target: armv7 35 + - runner: ubuntu-22.04 36 + target: s390x 37 + - runner: ubuntu-22.04 38 + target: ppc64le 39 + steps: 40 + - uses: actions/checkout@v4 41 + - name: Set version from git tag 42 + if: startsWith(github.ref, 'refs/tags/') 43 + run: sed -i "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" Cargo.toml 44 + - uses: actions/setup-python@v5 45 + with: 46 + python-version: 3.x 47 + - name: Build wheels 48 + uses: PyO3/maturin-action@v1 49 + with: 50 + target: ${{ matrix.platform.target }} 51 + args: --release --out dist --find-interpreter 52 + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} 53 + manylinux: auto 54 + - name: Upload wheels 55 + uses: actions/upload-artifact@v4 56 + with: 57 + name: wheels-linux-${{ matrix.platform.target }} 58 + path: dist 59 + - name: pytest 60 + if: ${{ startsWith(matrix.platform.target, 'x86_64') }} 61 + shell: bash 62 + run: | 63 + set -e 64 + python3 -m venv .venv 65 + source .venv/bin/activate 66 + pip install pmgfal --find-links dist --force-reinstall 67 + pip install pytest 68 + pytest 69 + - name: pytest 70 + if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} 71 + uses: uraimo/run-on-arch-action@v2 72 + with: 73 + arch: ${{ matrix.platform.target }} 74 + distro: ubuntu22.04 75 + githubToken: ${{ github.token }} 76 + install: | 77 + apt-get update 78 + apt-get install -y --no-install-recommends python3 python3-pip 79 + pip3 install -U pip pytest 80 + run: | 81 + set -e 82 + pip3 install pmgfal --find-links dist --force-reinstall 83 + pytest 29 84 85 + musllinux: 86 + runs-on: ${{ matrix.platform.runner }} 87 + strategy: 88 + matrix: 89 + platform: 90 + - runner: ubuntu-22.04 91 + target: x86_64 92 + - runner: ubuntu-22.04 93 + target: x86 94 + - runner: ubuntu-22.04 95 + target: aarch64 96 + - runner: ubuntu-22.04 97 + target: armv7 30 98 steps: 31 - - uses: actions/checkout@v5 32 - 33 - - name: install uv 34 - uses: astral-sh/setup-uv@v7 99 + - uses: actions/checkout@v4 100 + - name: Set version from git tag 101 + if: startsWith(github.ref, 'refs/tags/') 102 + run: sed -i "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" Cargo.toml 103 + - uses: actions/setup-python@v5 104 + with: 105 + python-version: 3.x 106 + - name: Build wheels 107 + uses: PyO3/maturin-action@v1 108 + with: 109 + target: ${{ matrix.platform.target }} 110 + args: --release --out dist --find-interpreter 111 + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} 112 + manylinux: musllinux_1_2 113 + - name: Upload wheels 114 + uses: actions/upload-artifact@v4 115 + with: 116 + name: wheels-musllinux-${{ matrix.platform.target }} 117 + path: dist 118 + - name: pytest 119 + if: ${{ startsWith(matrix.platform.target, 'x86_64') }} 120 + uses: addnab/docker-run-action@v3 121 + with: 122 + image: alpine:latest 123 + options: -v ${{ github.workspace }}:/io -w /io 124 + run: | 125 + set -e 126 + apk add py3-pip py3-virtualenv 127 + python3 -m virtualenv .venv 128 + source .venv/bin/activate 129 + pip install pmgfal --no-index --find-links dist --force-reinstall 130 + pip install pytest 131 + pytest 132 + - name: pytest 133 + if: ${{ !startsWith(matrix.platform.target, 'x86') }} 134 + uses: uraimo/run-on-arch-action@v2 35 135 with: 36 - enable-cache: true 37 - cache-dependency-glob: "uv.lock" 38 - 39 - - name: install dependencies 40 - run: uv sync 136 + arch: ${{ matrix.platform.target }} 137 + distro: alpine_latest 138 + githubToken: ${{ github.token }} 139 + install: | 140 + apk add py3-virtualenv 141 + run: | 142 + set -e 143 + python3 -m virtualenv .venv 144 + source .venv/bin/activate 145 + pip install pytest 146 + pip install pmgfal --find-links dist --force-reinstall 147 + pytest 41 148 42 - - name: check lockfile is up to date 149 + windows: 150 + runs-on: ${{ matrix.platform.runner }} 151 + strategy: 152 + matrix: 153 + platform: 154 + - runner: windows-latest 155 + target: x64 156 + - runner: windows-latest 157 + target: x86 158 + steps: 159 + - uses: actions/checkout@v4 160 + - name: Set version from git tag 161 + if: startsWith(github.ref, 'refs/tags/') 162 + shell: pwsh 43 163 run: | 44 - if ! uv lock --check; then 45 - echo "lockfile is out of date!" 46 - echo "to update the lockfile, run 'uv lock'." 47 - exit 1 48 - fi 49 - echo "lockfile is up to date" 164 + $version = $env:GITHUB_REF_NAME -replace '^v', '' 165 + (Get-Content Cargo.toml) -replace '^version = .*', "version = `"$version`"" | Set-Content Cargo.toml 166 + - uses: actions/setup-python@v5 167 + with: 168 + python-version: 3.x 169 + architecture: ${{ matrix.platform.target }} 170 + - name: Build wheels 171 + uses: PyO3/maturin-action@v1 172 + with: 173 + target: ${{ matrix.platform.target }} 174 + args: --release --out dist --find-interpreter 175 + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} 176 + - name: Upload wheels 177 + uses: actions/upload-artifact@v4 178 + with: 179 + name: wheels-windows-${{ matrix.platform.target }} 180 + path: dist 181 + - name: pytest 182 + if: ${{ !startsWith(matrix.platform.target, 'aarch64') }} 183 + shell: bash 184 + run: | 185 + set -e 186 + python3 -m venv .venv 187 + source .venv/Scripts/activate 188 + pip install pmgfal --find-links dist --force-reinstall 189 + pip install pytest 190 + pytest 50 191 51 - - name: run prek 52 - run: uv run prek run --all-files 53 - env: 54 - SKIP: no-commit-to-branch 192 + macos: 193 + runs-on: ${{ matrix.platform.runner }} 194 + strategy: 195 + matrix: 196 + platform: 197 + - runner: macos-13 198 + target: x86_64 199 + - runner: macos-14 200 + target: aarch64 201 + steps: 202 + - uses: actions/checkout@v4 203 + - name: Set version from git tag 204 + if: startsWith(github.ref, 'refs/tags/') 205 + run: sed -i '' "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" Cargo.toml 206 + - uses: actions/setup-python@v5 207 + with: 208 + python-version: 3.x 209 + - name: Build wheels 210 + uses: PyO3/maturin-action@v1 211 + with: 212 + target: ${{ matrix.platform.target }} 213 + args: --release --out dist --find-interpreter 214 + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} 215 + - name: Upload wheels 216 + uses: actions/upload-artifact@v4 217 + with: 218 + name: wheels-macos-${{ matrix.platform.target }} 219 + path: dist 220 + - name: pytest 221 + run: | 222 + set -e 223 + python3 -m venv .venv 224 + source .venv/bin/activate 225 + pip install pmgfal --find-links dist --force-reinstall 226 + pip install pytest 227 + pytest 55 228 56 - test: 57 - timeout-minutes: 5 229 + sdist: 58 230 runs-on: ubuntu-latest 231 + steps: 232 + - uses: actions/checkout@v4 233 + - name: Set version from git tag 234 + if: startsWith(github.ref, 'refs/tags/') 235 + run: sed -i "s/^version = .*/version = \"${GITHUB_REF_NAME#v}\"/" Cargo.toml 236 + - name: Build sdist 237 + uses: PyO3/maturin-action@v1 238 + with: 239 + command: sdist 240 + args: --out dist 241 + - name: Upload sdist 242 + uses: actions/upload-artifact@v4 243 + with: 244 + name: wheels-sdist 245 + path: dist 59 246 247 + release: 248 + name: Release 249 + runs-on: ubuntu-latest 250 + if: ${{ startsWith(github.ref, 'refs/tags/') }} 251 + needs: [linux, musllinux, windows, macos, sdist] 252 + permissions: 253 + # Use trusted publishing 254 + id-token: write 255 + # Used to upload release artifacts 256 + contents: write 257 + # Used to generate artifact attestation 258 + attestations: write 60 259 steps: 61 - - uses: actions/checkout@v5 62 - 63 - - name: install uv 64 - uses: astral-sh/setup-uv@v7 260 + - uses: actions/download-artifact@v4 261 + - name: Generate artifact attestation 262 + uses: actions/attest-build-provenance@v2 65 263 with: 66 - enable-cache: true 67 - cache-dependency-glob: "uv.lock" 68 - 69 - - name: install dependencies 70 - run: uv sync 71 - 72 - - name: run tests 73 - run: uv run pytest -v 264 + subject-path: 'wheels-*/*' 265 + - name: Publish to PyPI 266 + uses: PyO3/maturin-action@v1 267 + with: 268 + command: upload 269 + args: --non-interactive --skip-existing wheels-*/*
-34
.github/workflows/publish.yml
··· 1 - name: Publish pmgfal to PyPI 2 - on: 3 - release: 4 - types: [published] 5 - workflow_dispatch: 6 - 7 - jobs: 8 - pypi-publish: 9 - name: Upload to PyPI 10 - runs-on: ubuntu-latest 11 - permissions: 12 - id-token: write 13 - steps: 14 - - name: Checkout 15 - uses: actions/checkout@v5 16 - with: 17 - fetch-depth: 0 18 - 19 - - name: Set version from git tag 20 - run: | 21 - VERSION="${GITHUB_REF_NAME#v}" 22 - echo "VERSION=$VERSION" >> $GITHUB_ENV 23 - sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml 24 - echo "Set version to $VERSION" 25 - grep "^version" Cargo.toml 26 - 27 - - name: Install uv 28 - uses: astral-sh/setup-uv@v7 29 - 30 - - name: Build 31 - run: uv build 32 - 33 - - name: Publish to PyPI 34 - run: uv publish -v dist/*
+1 -1
Cargo.lock
··· 264 264 265 265 [[package]] 266 266 name = "pmgfal" 267 - version = "0.1.0" 267 + version = "0.0.0" 268 268 dependencies = [ 269 269 "atrium-lex", 270 270 "heck",