Skip to content

Commit

Permalink
Run PyPi workflow on branch PR
Browse files Browse the repository at this point in the history
Improve checks for publishing

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT committed Feb 22, 2023
1 parent 78090e0 commit 7858745
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pypi-wheel-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ run-name: Spglib PyPI Wheel builds for linux
on:
push:
tags: [ "v[0-9]+.[0-9]+.[0-9]+*" ]
pull_request:
branches: [ test-PyPi-action ]

jobs:
build_wheels:
Expand Down Expand Up @@ -45,6 +47,7 @@ jobs:
path: dist/*.tar.gz

upload_pypi:
name: Upload to pypi repository
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
steps:
Expand All @@ -53,14 +56,14 @@ jobs:
name: artifact
path: dist
- name: Publish package to TestPyPI
if: ${{ contains(github.ref, 'rc') }}
if: ${{ !contains(github.ref, 'test') && contains(github.ref, 'rc') && github.event_name != 'pull_request' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: ${{ !contains(github.ref, 'rc') }}
if: ${{ !contains(github.ref, 'test') && !contains(github.ref, 'rc') && github.event_name != 'pull_request' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down

0 comments on commit 7858745

Please sign in to comment.