Skip to content

Commit ab1b460

Browse files
authored
Merge pull request #252 from jaysonsantos/add-publish-step
chore: Add publish step
2 parents 7cc67ba + f650430 commit ab1b460

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI
2+
on: push
3+
jobs:
4+
build-n-publish:
5+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@master
9+
- name: Set up Python 3.10
10+
uses: actions/setup-python@v3
11+
with:
12+
python-version: "3.10"
13+
- name: Setup pandoc for changelog conversion
14+
run: sudo apt update && sudo apt install -y pandoc
15+
- name: Write pypi's readme
16+
run: |
17+
cat README.rst > to-pypi.rst
18+
echo "" >> to-pypi.rst
19+
pandoc -s --to rst -o /dev/stdout CHANGELOG.md | tee -a to-pypi.rst
20+
mv to-pypi.rst README.rst
21+
- name: Install pypa/build
22+
run: >-
23+
python -m
24+
pip install
25+
build
26+
--user
27+
- name: Build a binary wheel and a source tarball
28+
run: >-
29+
python -m
30+
build
31+
--sdist
32+
--wheel
33+
--outdir dist/
34+
.
35+
- name: Publish distribution 📦 to PyPI
36+
if: startsWith(github.ref, 'refs/tags')
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests-and-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
max-parallel: 4
1414
matrix:
15-
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, "3.10"]
15+
python-version: [2.7, 3.7, 3.8, 3.9, "3.10", 3.11]
1616

1717
steps:
1818
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)