-
Notifications
You must be signed in to change notification settings - Fork 44
51 lines (44 loc) · 1.34 KB
/
pypi_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
name: Build and upload to PyPI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "*"
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
MACOSX_DEPLOYMENT_TARGET: "10.14"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/pantab/
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/[email protected]
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1