From 776c1d35ca2e81020a7ff4ed286d21002cf366f5 Mon Sep 17 00:00:00 2001 From: rajeswari1301 Date: Thu, 26 Mar 2026 07:29:19 -0700 Subject: [PATCH] Switched to PyPI trusted publishing --- .github/workflows/publish.yml | 55 ++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f20931c1..d6594815 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,14 +1,49 @@ -name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI and announce to teams +name: Publish Python distribution to PyPI -on: push +on: + push: + tags: + - "v*" + workflow_dispatch: jobs: - build-n-publish: - runs-on: ubuntu-24.04 - name: Build and publish Python 🐍 distributions 📦 to PyPI + build: + name: Build distribution + runs-on: ubuntu-latest steps: - - uses: SuffolkLITLab/ALActions/publish@main - with: - PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - VERSION_TO_PUBLISH: ${{ env.GITHUB_REF_NAME }} - TEAMS_BUMP_WEBHOOK: ${{ secrets.TEAMS_BUMP_WEBHOOK }} + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + - name: Install build tool + run: python3 -m pip install --user build + - name: Build a binary wheel and source tarball + run: python3 -m build + - name: Store distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish distribution to PyPI + if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/docassemble-assemblyline + permissions: + id-token: write + steps: + - name: Download all distributions + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file