Skip to content

Commit

Permalink
Bump version to 0.1.0.dev1 and add homepage URL; create CI workflow f…
Browse files Browse the repository at this point in the history
…or publishing to PyPI
  • Loading branch information
mgao6767 committed Feb 2, 2025
1 parent 5e36759 commit b87e3d3
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 6 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish

on:
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
build:
name: Build distribution
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install the project
run: |
uv sync --all-extras --dev
uv pip install .
- name: Build
run: |
uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish Python distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/brms
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "brms"
version = "0.1.0"
version = "0.1.0.dev1"
description = "A bank risk management simulation framework."
readme = "README.md"
authors = [{ name = "Mingze Gao", email = "adrian.gao@outlook.com" }]
Expand All @@ -23,13 +23,16 @@ dependencies = [
[project.scripts]
brms = "brms.main:main"

[project.urls]
Homepage = "https://bankrisk.org"

[dependency-groups]
dev = [
"isort>=5.13.2",
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
"mkdocs-material>=9.6.1",
"pytest>=8.3.4",
"ruff>=0.8.5",
"isort>=5.13.2",
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
"mkdocs-material>=9.6.1",
"pytest>=8.3.4",
"ruff>=0.8.5",
]

[tool.hatch.build]
Expand Down

0 comments on commit b87e3d3

Please sign in to comment.