From 00e862c8833f5cadfe81984479edc8eb57ad7b64 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Wed, 4 Dec 2024 14:57:24 +0100 Subject: [PATCH] try claude's suggestion for pypi test workflow --- .github/workflows/pypi_test.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi_test.yml b/.github/workflows/pypi_test.yml index 6344faf..b7d46b1 100644 --- a/.github/workflows/pypi_test.yml +++ b/.github/workflows/pypi_test.yml @@ -11,16 +11,37 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: python-version: "3.10" + + - name: Configure Git + run: | + git config --global user.email "github-actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Create test version tag + run: | + # Get number of commits in current branch + COMMIT_COUNT=$(git rev-list --count HEAD) + # Get short SHA + SHA=$(git rev-parse --short HEAD) + # Create a PEP 440 compliant version number + VERSION="0.2.1.dev${COMMIT_COUNT}" + # Create and push tag + git tag -a "v${VERSION}" -m "Test release ${VERSION}" + echo "Created tag v${VERSION}" + - name: Install Hatch run: pip install hatch + - name: Build run: hatch build + - name: Publish distribution 📦 to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file