-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.17 KB
/
python-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
name: publish
on:
release:
types:
- published
permissions:
contents: read
jobs:
build-n-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Strip GitHub badges
run: |
awk '
BEGIN { in_block = 0 }
/\|/ && in_block == 0 { in_block = 1; print; next } # Print the first | and skip
/\|/ && in_block == 1 { in_block = 0; next } # Skip the second |
in_block == 0 { print } # Print lines outside the block
' README.rst > tmp && mv tmp README.rst
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build
pip install --upgrade .
- name: Build wheel and sdist
run: python -m build --sdist --wheel --outdir dist/
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}