Skip to content

Commit

Permalink
CI: split pypi build and deploy tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Puerling committed Dec 6, 2024
1 parent a5bad0d commit 738d3d3
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ jobs:
path: ui-cpp/ui-imgui/webapp/
if-no-files-found: error

deploy-pypi:
build-pypi:
if: github.event_name != 'pull_request'
needs:
- lint
Expand Down Expand Up @@ -823,21 +823,43 @@ jobs:
echo "Add suffix to spirit version tag for python package $SPIRIT_ADD_VERSION_SUFFIX"
python setup.py sdist bdist_wheel
- name: πŸš€ Deploy to TestPyPI
working-directory: ./core/python
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.ref != 'refs/heads/master'
run: twine upload --skip-existing --repository testpypi dist/*
- uses: actions/upload-artifact@v3
with:
name: dist-${{ matrix.os }}
path: ./dist
if-no-files-found: error

- name: πŸš€ Deploy to PyPI
working-directory: ./core/python
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.ref == 'refs/heads/master'
run: twine upload --skip-existing dist/*
deploy-pypi:
if: github.event_name != 'pull_request'
needs: ['build-pypi']
environment: 'publish'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/download-artifact@v3

- name: πŸ“š Install necessary packages
run: |
python -m pip install --upgrade pip
python -m pip install twine
- name: πŸš€ Deploy to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.ref != 'refs/heads/master'
run: twine upload --skip-existing --repository testpypi dist/*

- name: πŸš€ Deploy to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.ref == 'refs/heads/master'
run: twine upload --skip-existing dist/*

deploy-package:
if: github.event_name != 'pull_request'
Expand Down

0 comments on commit 738d3d3

Please sign in to comment.