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
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
tags: ["*"]

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/flashmd
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: python -m pip install tox tox-uv
- name: Check tag matches package version
if: startsWith(github.ref, 'refs/tags/v')
run: |
tag="${GITHUB_REF_NAME#v}"
version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
if [ "$tag" != "$version" ]; then
echo "tag $GITHUB_REF_NAME does not match pyproject.toml version $version"
exit 1
fi
- name: Build package
run: tox -e build
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
Comment thread
Luthaf marked this conversation as resolved.
- name: Publish to GitHub release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.tar.gz
dist/*.whl
prerelease: ${{ contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[project]
name = "flashmd"
version = "0.2.9"
version = "0.3.0"
requires-python = ">=3.11"

readme = "README.md"
license = {text = "Apache-2.0"}
license = "Apache-2.0"
description = "Accelerated molecular dynamics with large-time-step predictions"
authors = [{name = "flashmd developers"}]

Expand All @@ -20,7 +20,6 @@ keywords = ["machine learning", "molecular modeling", "molecular dynamics"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
Expand Down
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ commands =
pytest \
--import-mode=append \
{posargs}

[testenv:build]
description = Build the package and check its integrity
package = skip
deps =
build
twine
allowlist_externals = rm
commands_pre =
rm -rf {toxinidir}/dist
commands =
python -m build
twine check dist/*.tar.gz dist/*.whl
Loading