Skip to content

Commit

Permalink
Logic that PyPI upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeyers314 committed May 1, 2024
1 parent ef0182b commit 0436942
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ jobs:
build_sdist:
name: Build sdist and upload to PyPI
needs: [merge_wheels]
# Just need to build sdist on a single machine
runs-on: ubuntu-latest

steps:
Expand All @@ -170,11 +169,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
pip install build
pip install build setuptools_scm
pip install -U numpy setuptools
pip install -U -r requirements.txt
pip install -U pybind11-global
- name: Extract version
run: |
echo "PACKAGE_VERSION=$(python -c 'from setuptools_scm import get_version; print(get_version())')" >> $GITHUB_ENV
- name: Download wheels
uses: actions/download-artifact@v4
with:
Expand All @@ -196,15 +199,17 @@ jobs:
echo ls -l dist
ls -l dist
- name: Publish package to TestPyPI
- name: Publish to TestPyPI if alpha
if: "contains(env.PACKAGE_VERSION, 'a')"
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
password: ${{ secrets.TESTPYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/

# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_PASSWORD }}
# verbose: true
- name: Publish to PyPI if stable release
if: "!contains(env.PACKAGE_VERSION, 'a') && !contains(env.PACKAGE_VERSION, '.dev')"
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
verbose: true

0 comments on commit 0436942

Please sign in to comment.