Skip to content

Commit f8043c9

Browse files
committed
add pypi release workflow
1 parent c0d8761 commit f8043c9

4 files changed

Lines changed: 47 additions & 7 deletions

File tree

.github/workflows/pip-install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: pip-install-test
1+
name: pip-install
22

33
on:
44
pull_request:
55
branches: [ main ]
66
workflow_dispatch:
7-
7+
88

99
jobs:
1010
build:
@@ -31,7 +31,7 @@ jobs:
3131
# - name: Load cached poetry environment
3232
# id: cached-poetry-dependencies
3333
# uses: actions/cache@v2
34-
# with:
34+
# with:
3535
# path: .venv
3636
# key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
3737
# - name: Install dependencies

.github/workflows/pylint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: lint
1+
name: pylint
22

3-
on:
3+
on:
44
pull_request:
55
branches: [ main ]
66
workflow_dispatch:
@@ -27,7 +27,7 @@ jobs:
2727
- name: Load cached poetry environment
2828
id: cached-poetry-dependencies
2929
uses: actions/cache@v2
30-
with:
30+
with:
3131
path: .venv
3232
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
3333
- name: Install dependencies

.github/workflows/pypi-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# workflow copied from combination of
2+
# 1) https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
3+
# 2) https://www.caktusgroup.com/blog/2021/02/11/automating-pypi-releases/
4+
5+
name: pypi-release
6+
7+
on:
8+
release:
9+
types: [created]
10+
11+
jobs:
12+
deploy:
13+
name: Build and publish Python distribution to PyPI
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@master
18+
- name: Set up Python 3.10
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install pypa/build
24+
run: >-
25+
python -m
26+
pip install
27+
build
28+
--user
29+
- name: Build a binary wheel and a source tarball
30+
run: >-
31+
python -m
32+
build
33+
--sdist
34+
--wheel
35+
--outdir dist/
36+
.
37+
- name: Publish distribution to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1
39+
with:
40+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: build
4+
name: python-app
55

66
on:
77
push:

0 commit comments

Comments
 (0)