Skip to content
Snippets Groups Projects
Unverified Commit d162650e authored by Chris Holdgraf's avatar Chris Holdgraf Committed by GitHub
Browse files

MAINT: Move pypi publish to dedicated workflow (#1878)

parent 795c4b5c
No related branches found
No related tags found
No related merge requests found
# This will run every time a tag is created and pushed to the repository.
# It calls our tests workflow via a `workflow_call`, and if tests pass
# then it triggers our upload to PyPI for a new release.
name: Publish to PyPI
on:
release:
types: ["published"]
jobs:
tests:
uses: ./.github/workflows/tests.yml
publish:
name: publish
needs: [tests] # require tests to pass before deploy runs
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install flit
run: |
pip install flit~=3.6
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
...@@ -6,6 +6,7 @@ on: ...@@ -6,6 +6,7 @@ on:
tags: tags:
- 'v*' - 'v*'
pull_request: pull_request:
workflow_call:
env: env:
# Force colors for logs # Force colors for logs
...@@ -109,27 +110,3 @@ jobs: ...@@ -109,27 +110,3 @@ jobs:
- name: Run pytest - name: Run pytest
run: pytest --durations=10 -m 'not requires_tex' run: pytest --durations=10 -m 'not requires_tex'
publish:
name: Publish to PyPi
needs: [pre-commit, test-with-cov, tests]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install flit
run: |
pip install flit~=3.6
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment