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
11 changes: 8 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Docs
name: Publish Docs

on:
push:
branches: [main]
workflow_dispatch:
tags:
- "v*"

permissions:
contents: write

jobs:
test:
uses: ./.github/workflows/test.yml

deploy:
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: PR Tests

on:
pull_request:
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Publish to PyPI

on:
push:
tags:
- "v*"

permissions:
contents: read
id-token: write

jobs:
test:
uses: ./.github/workflows/test.yml

docs:
uses: ./.github/workflows/docs.yml

build-wheels:
runs-on: ${{ matrix.os }}
needs:
- test
- docs
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Build wheels (Rust-enabled)
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist
working-directory: rust-base32
manylinux: auto

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: rust-base32/dist/*.whl

build-sdist:
runs-on: ubuntu-latest
needs:
- test
- docs
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Sync deps (including build tools)
run: |
uv sync --all-extras --dev

- name: Build sdist
run: |
make build-sdist

- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

publish:
runs-on: ubuntu-latest
needs:
- build-wheels
- build-sdist
permissions:
contents: read
id-token: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist

- name: Flatten dist directory
shell: bash
run: |
mkdir -p out
find dist -type f \( -name "*.whl" -o -name "*.tar.gz" \) -maxdepth 4 -print -exec cp {} out/ \;
ls -la out

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: out
47 changes: 47 additions & 0 deletions .github/workflows/test-rust-accel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test Rust Acceleration

on:
workflow_call:
workflow_dispatch:
pull_request:
push:
branches: [main]

jobs:
test-rust-accel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Sync deps (locked)
run: |
uv sync --locked --all-groups --all-extras

- name: Build & install Rust extension (maturin develop)
uses: PyO3/maturin-action@v1
with:
command: develop
args: --release
working-directory: rust-base32

- name: Sanity check (import extension)
run: |
uv run python -c "import typeid_base32; print('typeid_base32 OK')"
7 changes: 3 additions & 4 deletions .github/workflows/setup.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Run Tests

on:
release:
Expand All @@ -7,14 +7,13 @@ on:
branches:
- main
paths-ignore:
- README.md
- CHANGELOG.md
- '**.md'

env:
PROJECT_NAME: typeid-python

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down