-
Notifications
You must be signed in to change notification settings - Fork 15
94 lines (78 loc) · 2.41 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This workflow is triggered by a new release on GitHub and then uploads
# MulensModel package to PyPI.
name: Upload Python Package to PyPI
on:
release:
types: [published]
workflow_dispatch:
jobs:
build_wheels:
name: ${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# A matrix of OSs, Python verisons, and architectures
# Skips PyPy
os: [ubuntu-latest, macos-latest]
cibw_archs: [auto64]
cibw_build: [cp37-*, cp38-*, cp39-*, cp310-*, cp311-*]
cibw_skip: [pp*]
include:
# MacOS Silicon (Python >= 3.8)
- {os: macos-latest, cibw_archs: "arm64", cw_build: "cp38-*"}
- {os: macos-latest, cibw_archs: "arm64", cw_build: "cp39-*"}
- {os: macos-latest, cibw_archs: "arm64", cw_build: "cp310-*"}
- {os: macos-latest, cibw_archs: "arm64", cw_build: "cp311-*"}
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: ${{ matrix.cibw_skip }}
- uses: actions/upload-artifact@v3
with:
name: wheelhouse
path: ./wheelhouse/*.whl
build_source:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: sdist
path: ./dist/*.tar.gz
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build_source, build_wheels]
steps:
- uses: actions/checkout@v3
- name: Download sdist artifacts to dist/
uses: actions/download-artifact@v3
with:
name: sdist
path: dist/
- name: Download wheelhouse artifacts to dist/
uses: actions/download-artifact@v3
with:
name: wheelhouse
path: dist/
- name: Publish package to PyPI
# All files in dist/ are published
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}