-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.42 KB
/
wheels.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
name: wheels
on:
workflow_dispatch:
inputs:
# Manual dispatch allows optional upload of wheels to PyPI
upload_dest:
type: choice
description: Upload wheels to
options:
- No Upload
- PyPI
- Test PyPI
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
# For PyPI Trusted Publisher
id-token: write
jobs:
publish_PyPI:
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make README links absolute
run: |
tools/make_readme_links_absolute.sh > README-PyPI.md
rm README.md
mv README-PyPI.md README.md
- name: Build
run: pipx run build
- name: Check
run: pipx run twine check dist/*
# Upload to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI')
with:
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}
# Upload to Test PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI'
with:
verbose: true
repository-url: https://test.pypi.org/legacy/