Skip to content

Commit f775cee

Browse files
committed
prep release
1 parent 90daaec commit f775cee

File tree

4 files changed

+101
-2
lines changed

4 files changed

+101
-2
lines changed

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish on PyPI
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
pypi:
7+
name: PyPI Release
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up python 3.10
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.10'
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install setuptools --upgrade
18+
python -m pip install packaging --upgrade
19+
- name: Set pyproject version
20+
run: |
21+
echo "PACKAGE=$(python -c 'import setuptools; setuptools.setup()' --version)" >> $GITHUB_ENV
22+
- name: Check package version (compare package version with tag)
23+
id: check_package_version
24+
shell: python
25+
run: |
26+
import os
27+
from packaging.version import parse
28+
package_version = os.getenv('PACKAGE')
29+
if parse(package_version) != parse('${{ github.event.release.tag_name }}'):
30+
print(f'version mismatch: {package_version} (in package) vs ${{ github.event.release.tag_name }} (GitHub tag)')
31+
exit(1)
32+
else:
33+
print('version match')
34+
exit(0)
35+
- name: Create whl and tar.gz files in sdist
36+
run: |
37+
rm -rf docs/ Examples/ tests/
38+
make package
39+
- name: Publish a Python distribution to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
username: __token__
43+
password: ${{ secrets.PYPI_API_TOKEN }}
44+
repository_url: https://upload.pypi.org/legacy/

baytune/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.4.1"
1+
__version__ = "0.5.0"

release.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Release Process
2+
3+
## 0. Pre-Release Checklist
4+
5+
Before starting the release process, verify the following:
6+
7+
- [GitHub Action for Unit Tests are green on main](https://github.com/MLBazaar/BTB/actions/workflows/tests.yml?query=branch:main)
8+
- [GitHub Action for Install Tests are green on main](https://github.com/MLBazaar/BTB/actions/workflows/install_test.yaml?query=branch:main)
9+
- Get agreement on the version number to use for the release.
10+
11+
#### Version Numbering
12+
13+
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>`.
14+
15+
## 1. Create BTB release on GitHub
16+
17+
#### Create Release Branch
18+
19+
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").
20+
21+
#### Bump Version Number
22+
23+
1. Bump `__version__` in `baytune/version.py`, and `tests/test_version.py`.
24+
25+
#### Update Changelog
26+
27+
1. Replace top most "What’s new in" in `docs/changelog.rst` with the current date
28+
29+
```
30+
What’s new in 0.3.1 (January 4, 2023)
31+
=====================================
32+
```
33+
34+
2. Remove any unused sections for this release (e.g. Enhancements, Fixes, Changes)
35+
3. The release PR does not need to be mentioned in the list of changes
36+
37+
#### Create Release PR
38+
39+
A release PR should have **the version number as the title** and the notes for that release as the PR body text.
40+
41+
Checklist before merging:
42+
43+
- The title of the PR is the version number.
44+
- All tests are currently green on checkin and on `main`.
45+
- PR has been reviewed and approved.
46+
47+
## 2. Create GitHub Release
48+
49+
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)
50+
51+
- The target should be the `main` branch
52+
- The tag should be the version number with a v prefix (e.g. v0.3.1)
53+
- Release title is the same as the tag
54+
- This is not a pre-release
55+
- Publishing the release will automatically upload the package to PyPI

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
def test_version():
5-
assert __version__ == "0.4.1"
5+
assert __version__ == "0.5.0"

0 commit comments

Comments
 (0)