[ab7503]: / .github / workflows / building-pypi-linux.yml

Download this file

108 lines (87 with data), 3.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
# 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: pypi
on:
push:
branches: [ main ]
jobs:
build_sdist:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make dev
make requirements
pip install cibuildwheel
# Update to only do push to pypi after succesfully running build-test.yml... instead of doing the tests here?
- name: Install
run: |
make install
- name: Test with pytest
run: |
make test
# build source distribution for versions wheels arent build.
# https://setuptools.pypa.io/en/latest/userguide/quickstart.html#install-build
- name: Build source distribution
run: |
make build
# python setup.py sdist -d wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: ./wheelhouse/*.tar.gz
#BUILD WHEELS ONLY NEEDED FOR NON-PURE PYTHON PACKAGES
#This is described here: https://packaging.python.org/en/latest/overview/#python-binary-distributions
build_wheels:
name: Build wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 = intel mac runner
# macos-14 = apple silicon mac runner
os: [ubuntu-latest, windows-2019, macos-13]
# add macos-14 when apple silicon mac runners are available
# for all of the python versions. Seems like only 3.10 + is
# available now, but is intended to be fixed:
# https://github.com/actions/setup-python/issues/808
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.7.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# - name: Build wheels
# uses: pypa/cibuildwheel@v2.2.2
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
upload_pypi:
needs: [build_sdist] #build_wheels
runs-on: ubuntu-latest
steps:
# https://cibuildwheel.pypa.io/en/stable/deliver-to-pypi/
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYMSKT_TOKEN }}
# password: ${{ secrets.PYMSKT_TESTPYPI_TOKEN }}
# COMMENT BELOW OUT - DEFAULT PUSH TO pypi now!
# repository_url: https://test.pypi.org/legacy/