diff --git a/.bumpversion.toml b/.bumpversion.toml new file mode 100644 index 00000000..3bf235c0 --- /dev/null +++ b/.bumpversion.toml @@ -0,0 +1,27 @@ + +[tool.bumpversion] +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" +serialize = ["{major}.{minor}.{patch}"] +regex = false +current_version = "1.0.3" +ignore_missing_version = false +search = "{current_version}" +replace = "{new_version}" +tag = false +sign_tags = false +tag_name = "{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = false +message = "Bump version: {current_version} → {new_version}" +commit_args = "" + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = "version = \"{current_version}\"" +replace = "version = \"{new_version}\"" + +[[tool.bumpversion.files]] +filename = "docs/conf.py" +search = "release = \"{current_version}\"" +replace = "release = \"{new_version}\"" \ No newline at end of file diff --git a/.github/workflows/publish-distribution.yaml b/.github/workflows/publish-distribution.yaml new file mode 100644 index 00000000..97fb9f75 --- /dev/null +++ b/.github/workflows/publish-distribution.yaml @@ -0,0 +1,36 @@ +name: Publish Distribution to PyPI + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +jobs: + build-and-publish-final-dist: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install Poetry + run: | + pip install poetry + + - name: Install dependencies + run: | + poetry install --without dev + + - name: Build the package + run: | + poetry build + + - name: Publish to PyPI + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} + run: | + poetry publish diff --git a/RELEASE.rst b/RELEASE.rst new file mode 100644 index 00000000..761c8b77 --- /dev/null +++ b/RELEASE.rst @@ -0,0 +1,70 @@ +Version Release Guidelines +======================= + +This document describes the guidelines for releasing new versions of the library. We follow semantic versioning, which means our version numbers have three parts: MAJOR.MINOR.PATCH. + +- MAJOR version when you make incompatible API changes +- MINOR version when you add functionality in a backwards-compatible manner +- PATCH version when you make backwards-compatible bug fixes + + +1. Install the `bump-my-version` package: + + ``` + pip install --upgrade bump-my-version + ``` +-------------------- + +2. Create a new branch for the release from dev branch: + + ``` + git checkout -b release/x.y.z + ``` +-------------------- + +3. Update the version number using the `bump-my-version` command: + + ``` + bump-my-version bump path + ``` + or + ``` + bump-my-version bump minor + ``` + or + ``` + bump-my-version bump major + ``` +-------------------- + +4. Commit the changes with the following message and push the changes to the release branch: + + ``` + git commit -m "Bump version: {current_version} → {new_version}" + ``` + + ``` + git push origin release/x.y.z + ``` + +-------------------- + +5. Create a pull request from the release branch to the dev branch. + +6. Once the pull request is approved and merged, create a new pull request from the dev branch to the master branch. + +7. Once the pull request is approved and merged, create the tag on the main branch to invoke the package publishing workflow: + + ``` + git tag -a x.y.z -m "Release x.y.z" + ``` + + ``` + git push origin tag + ``` +-------------------- + +8. Once the tag is pushed, the package publishing workflow will be triggered and the package will be published to the PyPI. + +9. Once the package is published, create a new release on GitHub with the tag name and the release notes (generate them automatically). + diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/conf.py b/docs/conf.py index e17de93e..6c80c711 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,7 @@ project = "NeuroBench" copyright = "2024, Jason Yik, Noah Pacik-Nelson, Korneel Van Den Berghe" author = "Jason Yik, Noah Pacik-Nelson, Korneel Van Den Berghe" -release = "v1.0.0" +release = "1.0.3" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration