Skip to content

Commit

Permalink
release: Push to PyPi when GitHub releases are created.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 638403273
  • Loading branch information
Nate Schmitz authored and Google Earth Engine Authors committed May 29, 2024
1 parent 16d97a8 commit 5e6f871
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Publish to PyPi
on: push
on:
release:
types: [published]

jobs:
build-artifacts:
Expand All @@ -24,7 +26,7 @@ jobs:
name: releases
path: ./python/dist

test-pypi-upload:
pypi-upload:
needs: build-artifacts
runs-on: ubuntu-latest
steps:
Expand All @@ -36,27 +38,24 @@ jobs:
with:
name: releases
path: dist
- name: Publish package to TestPyPI
if: github.event_name == 'push'
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true

check-test-pypi-package:
needs: test-pypi-upload
check-pypi-package:
needs: pypi-upload
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v3
name: Install Python
with:
python-version: 3.11
- name: Check uploaded package
if: github.event_name == 'push'
run: |
sleep 3 # To account for PyPi publish delay.
python -m pip install --upgrade pip
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade earthengine-api
python -m pip install --upgrade earthengine-api
python -c "import ee; print(ee.__version__)"

0 comments on commit 5e6f871

Please sign in to comment.