Skip to content

Commit

Permalink
Update publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Jul 20, 2023
1 parent 2d11176 commit 8f779f7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 46 deletions.
96 changes: 52 additions & 44 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: publish
name: Build and Publish Package

on:
create:
push:
tags:
- "v*"

jobs:
build-manylinux:

runs-on: ubuntu-latest
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.9']
os: [ubuntu-20.04, windows-2019, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -32,43 +33,50 @@ jobs:
- name: Test with pytest
run: |
make test
- name: Build manylinux Python wheels
uses: RalfG/[email protected]_x86_64
with:
build-requirements: 'cython'
- name: "Publish ManyLinux"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir dist/
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
run: |
twine upload dist/*manylinux*.whl dist/*.tar.gz
build-windows:
runs-on: windows-latest
CIBW_BUILD: "cp38* cp39* cp310*"
CIBW_SKIP: "*_i686 *win32 *musllinux* pp*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_TEST_REQUIRES: "pytest"
CIBW_BUILD_VERBOSITY: 5
CIBW_ARCHS: "auto"
- name: Upload Distributions
uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist/*.whl
dist/*.tar.gz
dist/*.zip
retention-days: 7

publish-wheels:
needs: [build-wheels]
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
pip install pytest -U
pip install Cython
pip install --only-binary=numpy numpy -U
pip install -e .
- name: Test with pytest
run: |
make test
- name: "Windows"
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
run: |
mkdir -p dist/
pip wheel --no-deps -w dist/ .
twine upload dist/pynumpress*.whl
shell: bash
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Install dependencies
run: |
python -m pip install -U pip setuptools wheel twine
- name: "Publish"
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
run: |
ls -l dist/*
twine upload dist/*.whl dist/*.tar.gz
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down

0 comments on commit 8f779f7

Please sign in to comment.