Skip to content

Commit

Permalink
improved workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Luca van den Busch committed Jan 31, 2024
1 parent d8b9622 commit eaf6631
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 131 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: PyPI publish

on:
release:
types:
- published

permissions:
contents: read

jobs:
build_wheels:
name: Build wheels on ${{ matrix.setup.os }}
runs-on: ${{ matrix.setup.os }}
strategy:
matrix:
setup:
- { os: ubuntu-latest, build:, "*manylinux*" }
- { os: ubuntu-latest, build:, "*musllinux*" }
- { os: macos-latest, build:, "*macosx*" }
- { os: windows-latest, build:, "*win*" }

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

- name: Build wheels
uses: pypa/cibuildwheel@v2.15.0
env:
CIBW_BUILD: ${{ matrix.setup.build }}
CIBW_SKIP: cp36* pp*

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build sdist and upload to PyPI
needs: build_wheels
runs-on: ubuntu-latest

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

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

- name: Install dependencies
run: |
python -m pip install pip
python -m pip install -r requirements.txt
- name: Build and install Python extension
run: |
python -m pip install -e .
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: ./wheels

- name: Build sdist
run: |
python setup.py sdist
ls -l dist
tar tvfz dist/balltree-*.tar.gz
- name: Copy wheels
run: |
echo ls -l wheels
ls -l wheels
echo ls -l wheels/artifact
ls -l wheels/artifact
cp wheels/artifact/*.whl dist
echo ls -l dist
ls -l dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Extension CI
name: Python CI

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout code
Expand All @@ -27,11 +27,12 @@ jobs:
with:
python-version: "${{ matrix.version }}"

- name: Install test dependencies
- name: Install dependencies
run: |
python -m pip install pip
python -m pip install -r requirements.txt
- name: Build Python extension
- name: Build and install Python extension
run: |
python -m pip install -e .
Expand Down
127 changes: 0 additions & 127 deletions .github/workflows/python-publish.yml

This file was deleted.

0 comments on commit eaf6631

Please sign in to comment.