From e371d3cb0e4d4577251b5e51641faee3c4e41228 Mon Sep 17 00:00:00 2001 From: Phuong Nguyen Date: Wed, 20 Nov 2024 10:56:54 +0200 Subject: [PATCH] fix: Temporarily stop using publish-pypi.yml reusable workflow --- .github/workflows/cicd.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 443d258..c36a27e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -21,11 +21,29 @@ jobs: contents: write publish-to-testpypi: - uses: NextGenContributions/cicd-pipeline/.github/workflows/publish-pypi.yml@main - with: - project_name: django2pydantic + # TODO(phuongfi91): Revisit this once Reusable Workflow is supported for Trusted Publishing + # Ref: https://github.com/pypi/warehouse/issues/11096 + # Workflow: NextGenContributions/cicd-pipeline/.github/workflows/publish-pypi.yml@main + name: Publish Python 🐍 distribution 📦 to TestPyPI + runs-on: ubuntu-latest if: ${{ needs.release.outputs.released == 'true' }} needs: - release permissions: id-token: write # IMPORTANT: mandatory for trusted publishing + + environment: + name: testpypi + url: ${{ format('https://test.pypi.org/p/{0}', 'django2pydantic') }} + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ +