@@ -6,39 +6,130 @@ SPDX-License-Identifier: CC0-1.0
66
77# How to cut a new release
88
9- 0 . Check if the package can be built properly.
10- Include "[ cd build] " in the commit message to trigger wheel building.
11- 1 . Update ` CHANGELOG.md ` with a short summary of important changes since
12- the previous stable release.
13- For example, deprecation or termination of support.
14- 2 . This project follows [ semantic versioning] [ semver ] .
15- Ensure the version and release date fields in these files
16- have been updated to the version of the new planned release:
17- - ` codemeta.json `
18- - ` pyproject.toml `
19- - ` CHANGELOG.md `
20- - ` CITATION.cff ` (will auto-generated from ` codemeta.json ` )
21- - ` README.md `
22- - ` README.TH.md `
23- 4 . Navigate to the [ releases page] [ releases ] and click the
9+ This project follows [ semantic versioning] [ semver ] .
10+
11+ ## Prerequisites
12+
13+ Install development dependencies including ` bump-my-version ` :
14+
15+ ``` sh
16+ pip install -e " .[dev]"
17+ ```
18+
19+ ## Release Process
20+
21+ 1 . ** Check if the package can be built properly**
22+
23+ Build the package locally to ensure there are no build errors:
24+
25+ ``` sh
26+ python -m build
27+ ```
28+
29+ You can also include ` [cd build] ` in a commit message to trigger wheel
30+ building in CI.
31+
32+ 2 . ** Update CHANGELOG.md**
33+
34+ Update ` CHANGELOG.md ` with a short summary of important changes since
35+ the previous stable release. For example, deprecation or termination
36+ of support. Follow the [ Keep a Changelog] [ keepachangelog ] format.
37+
38+ 3 . ** Update version using bump-my-version**
39+
40+ We use [ ` bump-my-version ` ] [ bump-my-version ] to manage version numbers.
41+ The configuration is in ` pyproject.toml ` under ` [tool.bumpversion] ` .
42+
43+ Version format: ` MAJOR.MINOR.PATCH[-RELEASE][BUILD] `
44+ where RELEASE can be ` dev ` , ` beta ` , or omitted (production).
45+
46+ ** To bump the version:**
47+
48+ ``` sh
49+ # For a patch release (e.g., 5.2.0 -> 5.2.1-dev0)
50+ bump-my-version bump patch
51+
52+ # For a minor release (e.g., 5.2.0 -> 5.3.0-dev0)
53+ bump-my-version bump minor
54+
55+ # For a major release (e.g., 5.2.0 -> 6.0.0-dev0)
56+ bump-my-version bump major
57+
58+ # To move from dev to beta (e.g., 5.2.1-dev0 -> 5.2.1-beta0)
59+ bump-my-version bump release
60+
61+ # To move from beta to production (e.g., 5.2.1-beta0 -> 5.2.1)
62+ bump-my-version bump release
63+
64+ # To increment build number (e.g., 5.2.1-dev0 -> 5.2.1-dev1)
65+ bump-my-version bump build
66+ ```
67+
68+ This command will automatically update version numbers and release dates in:
69+ - ` pyproject.toml ` - version number
70+ - ` pythainlp/__init__.py ` - version number
71+ - ` CITATION.cff ` - version number and ` date-released ` field
72+ - ` codemeta.json ` - version number and ` dateModified ` field
73+
74+ The release dates are automatically set to the current date when you run
75+ the bump command.
76+
77+ It will also create a git commit and tag by default.
78+
79+ 4 . ** Update README files if needed**
80+
81+ If the release introduces significant changes, update:
82+ - ` README.md `
83+ - ` README_TH.md `
84+
85+ 5 . ** Push changes and tag**
86+
87+ ``` sh
88+ git push origin dev
89+ git push origin --tags
90+ ```
91+
92+ 6 . ** Create GitHub Release**
93+
94+ Navigate to the [ releases page] [ releases ] and click the
2495 "Draft a new release" button.
2596 Only project maintainers are able to perform this step.
26- 5 . Then enter the new tag in the "Choose a tag" box.
27- The tag should begin with "v", as in, for instance, ` v5.0.1 ` .
28- 6 . The release title should be the same as the new version tag.
29- For instance, the title could be ` v5.0.1 ` .
30- 7 . Add a short summary of important changes since the previous stable
31- release.
32- _ This should be similar to what has been logged in ` CHANGELOG.md ` ._
33- Then click the "Generate release notes" button.
34- 8 . You can optionally include any particular thank-yous to contributors or
35- reviewers in a note at the bottom of the release.
36- 9 . You can then click "Publish release" button.
37- 10 . If [ the CI] [ ci ] run is [ successful] [ actions ] ,
38- then the release will be published on both
39- the GitHub release page and the [ Python Package Index] [ pypi ] .
97+
98+ 7 . ** Select the tag**
99+
100+ In the "Choose a tag" dropdown, select the tag that was created by
101+ ` bump-my-version ` (e.g., ` v5.2.1 ` ). Tags follow the format ` vMAJOR.MINOR.PATCH ` .
102+
103+ 8 . ** Set release title**
104+
105+ The release title should be the same as the version tag
106+ (e.g., ` v5.2.1 ` ).
107+
108+ 9 . ** Add release notes**
109+
110+ Add a short summary of important changes since the previous stable
111+ release. This should be similar to what has been logged in ` CHANGELOG.md ` .
112+ Then click the "Generate release notes" button to auto-generate
113+ contributor information.
114+
115+ 10 . ** Optional: Thank contributors**
116+
117+ You can optionally include any particular thank-yous to contributors or
118+ reviewers in a note at the bottom of the release.
119+
120+ 11 . ** Publish the release**
121+
122+ Click the "Publish release" button.
123+
124+ 12 . ** Verify CI/CD**
125+
126+ If [ the CI] [ ci ] run is [ successful] [ actions ] ,
127+ then the release will be published on both
128+ the GitHub release page and the [ Python Package Index] [ pypi ] .
40129
41130[ semver ] : https://semver.org/
131+ [ keepachangelog ] : https://keepachangelog.com/en/1.0.0/
132+ [ bump-my-version ] : https://github.com/callowayproject/bump-my-version
42133[ releases ] : https://github.com/PyThaiNLP/pythainlp/releases
43134[ ci ] : https://github.com/PyThaiNLP/pythainlp/blob/dev/.github/workflows/pypi-publish.yml
44135[ actions ] : https://github.com/PyThaiNLP/pythainlp/actions/workflows/pypi-publish.yml
0 commit comments