Skip to content

Commit

Permalink
combine .github/workflows/{test,publish}.yml into 1 workflow
Browse files Browse the repository at this point in the history
now triggering pypi publish on GH release instead of version tag push
  • Loading branch information
janosh committed Mar 16, 2022
1 parent f305c82 commit 24fd7e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 39 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/publish.yml

This file was deleted.

17 changes: 15 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ on:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.8
cache: pip
Expand All @@ -24,4 +26,15 @@ jobs:
run: pip install .[test]

- name: Run tests
id: tests
run: pytest --cov format_ipy_cells

- name: Build and upload dist
if: github.event_name == 'release' && steps.tests.outcome == 'success'
run: |
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*.tar.gz
env:
TWINE_USERNAME: janosh
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

0 comments on commit 24fd7e7

Please sign in to comment.