Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 18 additions & 31 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]