diff --git a/.github/workflows/build-and-deploy-release-pypi.yml b/.github/workflows/build-and-deploy-release-pypi.yml index d151d0c..5d133c0 100644 --- a/.github/workflows/build-and-deploy-release-pypi.yml +++ b/.github/workflows/build-and-deploy-release-pypi.yml @@ -1,10 +1,9 @@ name: Build and Upload Python Package -# on: -# release: -# types: [push] + on: + release: + types: [published] -on: [push] permissions: contents: read @@ -33,25 +32,14 @@ jobs: - name: Check distribution run: twine check dist/* -# - name: Upload to TestPyPI -# env: -# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN}} -# run: | -# twine upload --repository testpypi dist/* - - - name: Install package from TestPyPI + - name: Upload to TestPyPI + env: + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN}} run: | - python -m pip install --upgrade pip - pip install --index-url https://test.pypi.org/simple/ placekey==0.0.16.2 - pip install h3 shapely requests ratelimit backoff + twine upload --repository testpypi dist/* - - name: Run test query script + - name: Upload to PyPi env: - PLACEKEY_API_KEY: ${{ secrets.PLACEKEY_API_KEY }} - run: python run_test_query.py - -# - name: Upload to PyPi -# env: -# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN}} -# run: | -# twine upload dist/* + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN}} + run: | + twine upload dist/* diff --git a/run_test_query.py b/run_test_query.py deleted file mode 100644 index 7f4efa5..0000000 --- a/run_test_query.py +++ /dev/null @@ -1,19 +0,0 @@ -# run_test_query.py -import os -from placekey.api import PlacekeyAPI - -def main(): - api_key = os.environ['PLACEKEY_API_KEY'] - api = PlacekeyAPI(api_key=api_key, user_agent_comment='placekey-py-tests') - place = { - 'location_name': 'Pinecrest Food Market', - 'street_address': '401 Pinecrest Lake Rd', - 'city': 'Pinecrest', - 'region': 'CA', - 'postal_code': '95364', - 'iso_country_code': 'US' - } - print(api.lookup_placekeys([place], verbose=True)) - -if __name__ == '__main__': - main()