Skip to content

tuning: fix thread counts #2551

tuning: fix thread counts

tuning: fix thread counts #2551

Workflow file for this run

name: PyPI Packages
on:
push:
branches:
- main
- future/*
- series/*
pull_request:
release:
types: [published]
jobs:
sdist:
name: Build sdist
runs-on: ubuntu-latest
outputs:
lenskit-version: ${{steps.version.outputs.version}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🏷️ Fetch Git tags
run: git fetch --tags
- name: Install mise-en-place
uses: jdx/mise-action@v2
- name: 🕶️ Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12.5"
activate-environment: true
- name: Install dependencies
run: uv sync --only-group=scripting
env:
UV_LOCKED: 1
- name: Identify version
id: version
run: |
mise run version -- --github
- name: Build source distribution
id: sdist
run: |
mise run build:dist -- -ds
- name: Save archive
uses: actions/upload-artifact@v4
with:
name: pypi-dist-src
path: |
dist
!dist/CACHEDIR.TAG
- name: List dist dir
run: ls -R dist
wheels:
name: Build wheels for ${{matrix.plat.target}} on ${{ matrix.plat.host }}
needs: [sdist]
runs-on: ${{ matrix.plat.host }}
strategy:
fail-fast: false
matrix:
plat:
- host: ubuntu-22.04
pyarch: x64
target: x86_64
manylinux: 2_28
- host: ubuntu-24.04-arm
pyarch: arm64
target: aarch64
manylinux: 2_28
- host: windows-latest
pyarch: x64
target: x64
manylinux: auto
- host: macos-14
pyarch: arm64
target: aarch64
manylinux: auto
steps:
- name: Fetch source distribution
uses: actions/download-artifact@v4
with:
name: pypi-dist-src
path: dist
- name: List distribution directory
run: ls dist
- name: Extract source distribution
run: |
tar xvf dist/lenskit-${{needs.sdist.outputs.lenskit-version}}.tar.gz --strip-components=1
- uses: actions/setup-python@v5
with:
python-version: "3.14"
architecture: ${{matrix.plat.pyarch}}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist
target: ${{ matrix.plat.target }}
manylinux: ${{ matrix.plat.manylinux }}
- name: Build free-threaded wheels
uses: PyO3/maturin-action@v1
if: matrix.plat.host != 'windows-latest'
with:
args: --release --out dist -i 3.14t
target: ${{ matrix.plat.target }}
manylinux: ${{ matrix.plat.manylinux }}
- uses: actions/upload-artifact@v4
with:
name: pypi-dist-wheels-${{ matrix.plat.host }}-${{ matrix.plat.target }}
path: ./dist/*.whl
dev-publish:
name: Publish to INERTIAL PyPI
runs-on: ubuntu-latest
needs: [sdist, wheels]
if: github.event_name == 'push' || github.event_name == 'release'
environment: local-pip
steps:
- name: Fetch compiled package distributions
uses: actions/download-artifact@v4
with:
pattern: pypi-dist-*
path: dist
merge-multiple: true
- name: List packages
run: ls dist
- name: 🕶️ Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12.5"
activate-environment: true
- name: Set up Rclone configuration
run: |
sudo apt install -y rclone
mkdir -p ~/.config/rclone
pass=$(rclone obscure $WEBDAV_PASSWORD)
cat >~/.config/rclone/rclone.conf <<EOF
[inertial-pypi]
type = webdav
url = https://inertial.cci.drexel.edu/dist/lenskit-dev/
vendor = other
user = $WEBDAV_USER
pass = $pass
EOF
env:
WEBDAV_USER: ${{vars.WEBDAV_USER}}
WEBDAV_PASSWORD: ${{secrets.WEBDAV_PASSWORD}}
- name: List remote
run: "rclone lsd inertial-pypi:"
- name: Upload packages
run: |
rclone copy --exclude=CACHEDIR.TAG dist inertial-pypi:packages/
- name: List all packages
run: |
rclone lsf inertial-pypi:packages/ |tee packages.lst
- name: Prepare package index
run: |
uvx dumb-pypi --output-dir index --package-list packages.lst --packages-url https://inertial.cci.drexel.edu/dist/lenskit-dev/packages/
- name: Upload package index
run: |
rclone copy index inertial-pypi:
- name: "🧑🏼‍🎤 Activate central index update"
uses: actions/script@v7
with:
github-token: "${{ secrets.INDEX_TOKEN }}"
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'lenskit',
repo: 'lenskit-pypi',
workflow_id: 'publish.yml',
ref: 'main',
})
pypi-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [sdist, wheels]
if: github.event_name == 'release'
environment: release
permissions:
id-token: write
steps:
- name: Fetch compiled package distributions
uses: actions/download-artifact@v4
with:
pattern: pypi-dist-*
path: dist
merge-multiple: true
- name: List distribution artifacts
run: ls -R dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1