Skip to content

Commit

Permalink
Merge pull request #220 from MLBazaar/release_v0.5.0
Browse files Browse the repository at this point in the history
v0.5.0
  • Loading branch information
gsheni authored Jul 28, 2023
2 parents 90daaec + f775cee commit 9b4500e
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish on PyPI
on:
release:
types: [published]
jobs:
pypi:
name: PyPI Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install setuptools --upgrade
python -m pip install packaging --upgrade
- name: Set pyproject version
run: |
echo "PACKAGE=$(python -c 'import setuptools; setuptools.setup()' --version)" >> $GITHUB_ENV
- name: Check package version (compare package version with tag)
id: check_package_version
shell: python
run: |
import os
from packaging.version import parse
package_version = os.getenv('PACKAGE')
if parse(package_version) != parse('${{ github.event.release.tag_name }}'):
print(f'version mismatch: {package_version} (in package) vs ${{ github.event.release.tag_name }} (GitHub tag)')
exit(1)
else:
print('version match')
exit(0)
- name: Create whl and tar.gz files in sdist
run: |
rm -rf docs/ Examples/ tests/
make package
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
username: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://upload.pypi.org/legacy/
2 changes: 1 addition & 1 deletion baytune/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.1"
__version__ = "0.5.0"
55 changes: 55 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Release Process

## 0. Pre-Release Checklist

Before starting the release process, verify the following:

- [GitHub Action for Unit Tests are green on main](https://github.com/MLBazaar/BTB/actions/workflows/tests.yml?query=branch:main)
- [GitHub Action for Install Tests are green on main](https://github.com/MLBazaar/BTB/actions/workflows/install_test.yaml?query=branch:main)
- Get agreement on the version number to use for the release.

#### Version Numbering

BTB uses [semantic versioning](https://semver.org/). Every release has a major, minor and patch version number, and are displayed like so: `<majorVersion>.<minorVersion>.<patchVersion>`.

## 1. Create BTB release on GitHub

#### Create Release Branch

1. Branch off of BTB main. For the branch name, please use "release_vX.Y.Z" as the naming scheme (e.g. "release_v0.3.1").

#### Bump Version Number

1. Bump `__version__` in `baytune/version.py`, and `tests/test_version.py`.

#### Update Changelog

1. Replace top most "What’s new in" in `docs/changelog.rst` with the current date

```
What’s new in 0.3.1 (January 4, 2023)
=====================================
```
2. Remove any unused sections for this release (e.g. Enhancements, Fixes, Changes)
3. The release PR does not need to be mentioned in the list of changes
#### Create Release PR
A release PR should have **the version number as the title** and the notes for that release as the PR body text.
Checklist before merging:
- The title of the PR is the version number.
- All tests are currently green on checkin and on `main`.
- PR has been reviewed and approved.
## 2. Create GitHub Release
After the release pull request has been merged into the `main` branch, it is time draft [the GitHub release](https://github.com/HDI-Project/BTB/releases/new)
- The target should be the `main` branch
- The tag should be the version number with a v prefix (e.g. v0.3.1)
- Release title is the same as the tag
- This is not a pre-release
- Publishing the release will automatically upload the package to PyPI
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "0.4.1"
assert __version__ == "0.5.0"

0 comments on commit 9b4500e

Please sign in to comment.