From 85a0bf9769af4f87f763e9f600eadf30ec4e105e Mon Sep 17 00:00:00 2001 From: Aaron Fabbri Date: Thu, 13 Jun 2024 17:29:50 +0000 Subject: [PATCH] CI: workflow for publishing to pypi.org --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9ebf4d9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +# .github/workflows/publish.yml +jobs: + pypi-publish: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/interface-gen + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + # retrieve your distributions here + - name: Check out source repository + uses: actions/checkout@v4 + - name: Set up Python environment + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + working-directory: . + run: pip install -r requirements.txt + - name: Install twine + working-directory: . + run: pip install twine + - name: Build package distributions + working-directory: . + run: python -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1