Skip to content

Commit ba108d0

Browse files
committed
publish to pypi on github release
1 parent ad852c1 commit ba108d0

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish to PyPi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Install dependencies
16+
run: |
17+
python3 -m pip install --upgrade build
18+
python3 -m build
19+
20+
- name: Publish package
21+
uses: pypa/gh-action-pypi-publish@release/v1
22+
with:
23+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,10 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v3
3939

40-
- name: Set up Python
41-
uses: actions/setup-python@v4
42-
with:
43-
python-version: "3.11"
44-
4540
- name: Install test dependencies
4641
run: |
4742
python -m pip install --upgrade --no-cache-dir pip
4843
pip install --no-cache-dir flake8
4944
5045
- name: Test linting with flake8
5146
run: flake8 --max-line-length=127
52-
53-
publish:
54-
runs-on: ubuntu-latest
55-
needs: [tests, linting]
56-
steps:
57-
- name: Publish package
58-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
59-
uses: pypa/gh-action-pypi-publish@release/v1
60-
with:
61-
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)