diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml index a4ae72b5..e96f376c 100644 --- a/.github/workflows/pypi-package.yml +++ b/.github/workflows/pypi-package.yml @@ -5,8 +5,6 @@ on: push: branches: [main] tags: ["*"] - pull_request: - branches: [ main ] release: types: - published @@ -14,7 +12,6 @@ on: permissions: contents: read - id-token: write jobs: build-package: @@ -29,9 +26,9 @@ jobs: auto-release-test-pypi: runs-on: ubuntu-latest needs: [build-package] - # if: github.event_name == 'push' && github.ref == 'refs/heads/main' - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'nipreps/eddymotion' }} - + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + permissions: + id-token: write steps: - name: Download packages built by build-and-inspect-python-package uses: actions/download-artifact@v4 @@ -41,16 +38,19 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + skip-existing: true auto-release-pypi: runs-on: ubuntu-latest environment: "Release" needs: [build-package] if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + permissions: + id-token: write steps: - name: Download packages built by build-and-inspect-python-package uses: actions/download-artifact@v4 with: name: Packages path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index c9de63d9..6faf5185 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,11 @@ packages = ["src/eddymotion"] [tool.hatch.version] validate-bump = true source = "vcs" -raw-options = { version_scheme = "nipreps-calver" } + +[tool.hatch.version.raw-options] +version_scheme = "nipreps-calver" +local_scheme = "no-local-version" + [tool.hatch.build.hooks.vcs] version-file = "src/eddymotion/_version.py"