From c8f85198ff7c29ce8b4f5a2081f48d7001276f62 Mon Sep 17 00:00:00 2001 From: Scott Hansen Date: Thu, 14 Nov 2024 17:10:07 -0800 Subject: [PATCH] Simplify and update Action workflow to release to GH and PyPi on tag pushes and TestPyPi on commits. --- .github/workflows/main.yml | 23 ++++++++++------------- pyproject.toml | 3 +++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 096f135..4e4a895 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,22 +11,20 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensures version gets set correctly - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.x" - name: Install Hatch run: | python -m pip install --upgrade pip - pip install hatch + pip install hatch hatchling hatch-vcs - name: Build package run: hatch build @@ -34,12 +32,11 @@ jobs: - name: Store the distribution packages uses: actions/upload-artifact@v4 with: - name: python-package-distributions + name: urlscan path: dist/ publish-to-pypi: - name: >- - Publish to PyPI + name: Publish to PyPI if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes needs: - build @@ -54,7 +51,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - name: python-package-distributions + name: urlscan path: dist/ - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 @@ -74,7 +71,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - name: python-package-distributions + name: urlscan path: dist/ - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v3.0.0 @@ -118,7 +115,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - name: python-package-distributions + name: urlscan path: dist/ - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index a93bcb7..ef99d28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,9 @@ Homepage = "https://github.com/firecat53/urlscan" source = "vcs" fallback-version = "0.0.0" +[tool.hatch.version.raw-options] +local_scheme = "no-local-version" + [tool.hatch.build.hooks.vcs] version-file = "urlscan/_version.py"