-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (63 loc) · 1.8 KB
/
pypi-build-test-publish.yml
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
name: PyPI Build Python 🐍 wheel 🎡, Test 📝, and Publish 🎉.
on:
push:
branches: [ main ]
paths:
- 'src/**'
- 'tests/**'
- setup.py
- setup.cfg
- pyproject.toml
pull_request:
branches: [ main ]
release:
types: [published]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [38, 39, 310, 311]
include:
- os: ubuntu-latest
platform_id: manylinux_x86_64
- os: macos-latest
platform_id: macosx_x86_64
steps:
- uses: actions/checkout@v2
- name: Get history and tags for SCM versioning
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
env:
CIBW_ENVIRONMENT_MACOS: F90=gfortran-11
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
- name: Upload Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: nupyprop-gh-pypi-artifact
path: wheelhouse/*.whl
retention-days: 1
publish:
name: Publish wheels to PyPI
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v2
with:
name: nupyprop-gh-pypi-artifact
path: wheelhouse/
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_SECRET }}
packages_dir: wheelhouse/