Add a github action to automate releases to PyPI (thanks @hanifbirgani)

This commit is contained in:
Emil Stenström 2021-08-31 19:03:25 +02:00 committed by GitHub
commit 8dfaa95afa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 0 deletions

46
.github/workflows/publish-to-pypi.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: Publish to PyPI
on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

View file

@ -116,6 +116,14 @@ TEMPLATES = [
<sub><b>Dan Jacob</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/hanifbirgani">
<img src="https://avatars.githubusercontent.com/u/53351186?v=4" width="100;" alt="hanifbirgani"/>
<br />
<sub><b>Hanif Birgani</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/telenieko">
<img src="https://avatars.githubusercontent.com/u/10505?v=4" width="100;" alt="telenieko"/>