From bb424c003a37b754185240262ec4516047db7745 Mon Sep 17 00:00:00 2001 From: Yaron de Leeuw Date: Fri, 14 Jul 2023 20:27:45 +0300 Subject: [PATCH] Add workflow to publish releases to PyPI. Fixes #73 --- .github/workflows/publish-to-pypi.yaml | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yaml diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml new file mode 100644 index 0000000..5ad9ce3 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yaml @@ -0,0 +1,36 @@ +name: Build, and perhaps publish to PyPI + +on: push + +jobs: + build-and-publish: + name: Build and optionally publish + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/pygtfs + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python3 -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish tagged versions to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1