-
Notifications
You must be signed in to change notification settings - Fork 16
71 lines (54 loc) · 1.64 KB
/
release-to-pypi.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
name: Release to PyPI
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-wheels:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out the release commit
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
if: runner.os == 'Linux'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python packages needed for wheel build and upload
run: python -m pip install twine
- name: Build wheels
uses: pypa/[email protected]
- name: Check and upload wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict wheelhouse/*.whl
python -m twine upload --skip-existing wheelhouse/*.whl
build-sdist:
runs-on: ubuntu-latest
steps:
- name: Check out the release commit
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python packages needed for sdist build and upload
run: python -m pip install twine build
- name: Build sdist
run: python -m build --sdist
- name: Publish sdist to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict dist/*
python -m twine upload --skip-existing dist/*