From 06e3904cf90a551c47afe55e62919e3bf2f682ab Mon Sep 17 00:00:00 2001 From: misi9170 Date: Thu, 26 Feb 2026 16:25:04 -0700 Subject: [PATCH] Add pypi publishing workflow --- .github/workflows/python-publish.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 00000000..3d849a8c --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,34 @@ +# This workflows will upload a Python Package using Twine when a release is created +# Published via GitHub Actions as a PyPI Trusted Publisher. +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries +# and: https://docs.pypi.org/trusted-publishers/ + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + environment: release-pypi + if: github.repository_owner == 'NatLabRockies' + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.x' + - name: Install dependencies and build package + run: | + python -m pip install --upgrade pip + pip install build twine + python -m build + twine check --strict dist/* + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: True