diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0f3f63b..b6fd676 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -17,26 +17,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" - - name: Create venv - run: uv venv - - name: Install build dependencies - run: uv pip install setuptools wheel build - - name: Build the package - run: uv run python -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-packages - path: dist/ + - if: github.repository == 'chrishas35/simplefin-python-test' + run: sed -i -e 's/name = "simplefin"/name = "simplefin-test"/g' pyproject.toml + - uses: hynek/build-and-inspect-python-package@v2 publish-to-pypi: name: Publish to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + if: github.repository == 'chrishas35/simplefin-python' && startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes runs-on: ubuntu-24.04 needs: [build] environment: @@ -48,8 +35,8 @@ jobs: - name: Download distribution packages uses: actions/download-artifact@v4 with: - name: python-packages - path: dist/ + name: Packages + path: dist - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -68,22 +55,22 @@ jobs: - name: Download distribution packages uses: actions/download-artifact@v4 with: - name: python-packages - path: dist/ + name: Packages + path: dist - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v3.0.0 with: inputs: >- ./dist/*.tar.gz ./dist/*.whl - - name: Create GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - run: >- - gh release create - "$GITHUB_REF_NAME" - --repo "$GITHUB_REPOSITORY" - --notes "" + # - name: Create GitHub Release + # env: + # GITHUB_TOKEN: ${{ github.token }} + # run: >- + # gh release create + # "$GITHUB_REF_NAME" + # --repo "$GITHUB_REPOSITORY" + # --notes "" - name: Upload artifact signatures to GitHub Release env: GITHUB_TOKEN: ${{ github.token }} @@ -108,8 +95,8 @@ jobs: - name: Download distribution packages uses: actions/download-artifact@v4 with: - name: python-packages - path: dist/ + name: Packages + path: dist - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/pyproject.toml b/pyproject.toml index f198334..093cdb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,3 +30,6 @@ dev = [ [tool.hatch.version] source = "vcs" raw-options = { local_scheme = "no-local-version" } + +[tool.hatch.build.targets.wheel] +packages = ["src/simplefin"] \ No newline at end of file