-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrating deploy workflow * Added release step
- Loading branch information
1 parent
f670180
commit cbe1a14
Showing
1 changed file
with
54 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build and Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install build tools | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel build twine | ||
- name: Build distribution | ||
run: | | ||
python -m build --sdist | ||
python -m build --wheel | ||
- 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 | ||
run: | | ||
pip install --index-url https://test.pypi.org/simple/ placekey | ||
- name: Run test Query | ||
env: | ||
PLACEKEY_API_KEY: ${{ secrets.PLACEKEY_API_KEY }} | ||
run: | | ||
python -c "import os; from placekey.api import PlacekeyAPI; api = PlacekeyAPI(api_key=os.environ['PLACEKEY_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))" | ||
- name: Upload to PyPi | ||
env: | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN}} | ||
run: | | ||
twine upload dist/* |