-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (66 loc) · 2 KB
/
Copy pathpython-publish.yml
File metadata and controls
76 lines (66 loc) · 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
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build and Deploy on PyPi
on:
release:
types: [published]
workflow_dispatch:
inputs:
publish:
description: publish to PyPi
type: boolean
required: false
default: false
jobs:
build-wheel:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Build wheels for cp38 cp39 cp310
env:
CIBW_BUILD: 'cp38-* cp39-* cp310-*'
CIBW_SKIP: '*-musllinux_*'
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_WINDOWS: AMD64
CIBW_BUILD_VERBOSITY: 1
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir dist
- name: Store wheel
uses: actions/upload-artifact@v2
with:
name: python-package-distributions
path: dist
deploy:
if: github.event_name == 'release' || inputs.publish
name: Publish to PyPi
needs:
- build-wheel
runs-on: ubuntu-latest
steps:
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: python-package-distributions
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}