Skip to content

Commit

Permalink
Merge pull request #1245 from gboeing/pypi
Browse files Browse the repository at this point in the history
Add PyPI publishing workflow
  • Loading branch information
gboeing authored Dec 8, 2024
2 parents 8b8276b + 2f8b13a commit d20ef1c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish package to PyPI

on:
push:
tags:
- 'v*'
schedule:
- cron: "0 6 * * 1" # every monday at 06:00 UTC
workflow_dispatch:

jobs:
build_publish_pypi:
if: ${{ github.repository == 'gboeing/osmnx' }}
name: Build and publish on PyPI
runs-on: ubuntu-latest

defaults:
run:
shell: bash -elo pipefail {0}

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build and check package
run: |
python -m pip install --user hatch twine validate-pyproject[all]
python -m validate_pyproject ./pyproject.toml
python -m hatch build --clean
python -m twine check --strict ./dist/*
- name: Publish package to PyPI
if: ${{ github.event_name != 'schedule' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
print-hash: true
verbose: true
verify-metadata: true

0 comments on commit d20ef1c

Please sign in to comment.