-
Notifications
You must be signed in to change notification settings - Fork 36
62 lines (51 loc) · 1.52 KB
/
pypi.yml
File metadata and controls
62 lines (51 loc) · 1.52 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
name: Publish to PyPI
on:
pull_request:
push:
branches:
- main
release:
types:
- published
defaults:
run:
shell: bash
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/python-ctd/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
# Should be enough for setuptools-scm
fetch-depth: 100
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.x"
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Install build tools
run: |
python -m pip install --upgrade build
- name: Build sdist and binary wheel
run: python -m build --sdist --wheel . --outdir dist
- name: CheckFiles
run: |
ls dist
python -m pip install --upgrade check-manifest
check-manifest --verbose
- name: Test wheels
run: |
cd dist && python -m pip install *.whl
python -m pip install --upgrade twine
python -m twine check *
- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0