-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release: Push to PyPi when GitHub releases are created.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -24,7 +26,7 @@ jobs: | |
name: releases | ||
path: ./python/dist | ||
|
||
test-pypi-upload: | ||
pypi-upload: | ||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -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__)" |