From e9e327cbdd38a2eff5359b8008a436c2bc81000e Mon Sep 17 00:00:00 2001 From: Juan Colonese Date: Tue, 16 Jan 2024 12:33:04 +0000 Subject: [PATCH] tricks scm for testpypi and pep440 --- .github/workflows/cd.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0a4febc..9edc711 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -42,22 +42,33 @@ jobs: name: python-package-distributions path: dist/ - publish-to-test-pypi: + build-publish-to-test-pypi: runs-on: ubuntu-latest - needs: - - build environment: name: testpypi url: https://test.pypi.org/p/pyflow-wellies permissions: id-token: write steps: - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: disable scm local version + run: | + echo 'local_scheme = "no-local-version" >> pyproject.toml + git diff --color=always + git update-index --assume-unchanged pyproject.toml + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/