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
78 changes: 78 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish Python distribution to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sphinx-ymmsl
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

publish-to-testpypi:
name: Publish Python distribution to TestPyPI
if: github.ref == 'refs/heads/main'
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/sphinx-ymmsl

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# sphinx-ymmsl: Sphinx plugin for documenting yMMSL models

## Build documentation
This project provides a sphinx plugin for documenting yMMSL models, used with the
MUSCLE3 simulation framework.
See the [online documentation](https://sphinx-ymmsl.readthedocs.io/) for more details.

## Installation

> **TODO**: deploy documentation
`sphinx-ymmsl` is available on [PyPI](https://pypi.org/project/sphinx-ymmsl/) and can be
installed with `pip`:

```bash
pip install sphinx-ymmsl
```

## Build documentation

Documentation for this project can be generated using Sphinx. The following `make`
command will build HTML documentation, which you can view by opening
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ authors = [
]
classifiers = [
]
license = {file = "LICENSE.txt"}
license = "Apache-2.0"
license-files = ["LICENSE.txt"]
dependencies = [
"myst-parser",
"ymmsl >= 0.15",
Expand All @@ -32,6 +33,8 @@ docs = [

[project.urls]
homepage = "https://github.com/multiscale/sphinx-ymmsl"
documentation = "https://sphinx-ymmsl.readthedocs.io/"
issues = "https://github.com/multiscale/sphinx-ymmsl/issues"

[tool.setuptools.packages.find]
where = ["."]
Expand Down
Loading