Skip to content

Commit 24fd7e7

Browse files
committed
combine .github/workflows/{test,publish}.yml into 1 workflow
now triggering pypi publish on GH release instead of version tag push
1 parent f305c82 commit 24fd7e7

File tree

2 files changed

+15
-39
lines changed

2 files changed

+15
-39
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
release:
9+
types: [published]
810

911
jobs:
1012
tests:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- name: Check out repo
14-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1517

1618
- name: Set up Python 3.8
17-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v3
1820
with:
1921
python-version: 3.8
2022
cache: pip
@@ -24,4 +26,15 @@ jobs:
2426
run: pip install .[test]
2527

2628
- name: Run tests
29+
id: tests
2730
run: pytest --cov format_ipy_cells
31+
32+
- name: Build and upload dist
33+
if: github.event_name == 'release' && steps.tests.outcome == 'success'
34+
run: |
35+
pip install setuptools wheel twine
36+
python setup.py sdist bdist_wheel
37+
twine upload --skip-existing dist/*.tar.gz
38+
env:
39+
TWINE_USERNAME: janosh
40+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

0 commit comments

Comments
 (0)