Skip to content

Commit 7537ab9

Browse files
Copilotbact
andcommitted
Automate release date updates in CITATION.cff and codemeta.json
Co-authored-by: bact <128572+bact@users.noreply.github.com>
1 parent 483377f commit 7537ab9

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,23 @@ filename = "CITATION.cff"
281281
search = 'version: {current_version}'
282282
replace = 'version: {new_version}'
283283

284+
[[tool.bumpversion.files]]
285+
filename = "CITATION.cff"
286+
regex = true
287+
search = 'date-released: \d{{4}}-\d{{2}}-\d{{2}}'
288+
replace = 'date-released: {now:%Y-%m-%d}'
289+
284290
[[tool.bumpversion.files]]
285291
filename = "codemeta.json"
286292
search = '"version": "{current_version}"'
287293
replace = '"version": "{new_version}"'
288294

295+
[[tool.bumpversion.files]]
296+
filename = "codemeta.json"
297+
regex = true
298+
search = '"dateModified": "\d{{4}}-\d{{2}}-\d{{2}}"'
299+
replace = '"dateModified": "{now:%Y-%m-%d}"'
300+
289301
[tool.bumpversion.parts.release]
290302
optional_value = "prod"
291303
first_value = "dev"

release.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,66 +65,63 @@ pip install -e ".[dev]"
6565
bump-my-version bump build
6666
```
6767

68-
This command will automatically update version numbers in:
69-
- `pyproject.toml`
70-
- `pythainlp/__init__.py`
71-
- `CITATION.cff`
72-
- `codemeta.json`
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
7373

74-
It will also create a git commit and tag by default.
75-
76-
4. **Update release date in metadata files**
74+
The release dates are automatically set to the current date when you run
75+
the bump command.
7776

78-
After bumping the version, manually update the release date fields:
79-
- `codemeta.json`: Update `dateModified` field
80-
- `CITATION.cff`: Update `date-released` field
77+
It will also create a git commit and tag by default.
8178

82-
5. **Update README files if needed**
79+
4. **Update README files if needed**
8380

8481
If the release introduces significant changes, update:
8582
- `README.md`
8683
- `README_TH.md`
8784

88-
6. **Push changes and tag**
85+
5. **Push changes and tag**
8986

9087
```sh
9188
git push origin dev
9289
git push origin --tags
9390
```
9491

95-
7. **Create GitHub Release**
92+
6. **Create GitHub Release**
9693

9794
Navigate to the [releases page][releases] and click the
9895
"Draft a new release" button.
9996
Only project maintainers are able to perform this step.
10097

101-
8. **Select the tag**
98+
7. **Select the tag**
10299

103100
In the "Choose a tag" dropdown, select the tag that was created by
104101
`bump-my-version` (e.g., `v5.2.1`). Tags follow the format `vMAJOR.MINOR.PATCH`.
105102

106-
9. **Set release title**
103+
8. **Set release title**
107104

108105
The release title should be the same as the version tag
109106
(e.g., `v5.2.1`).
110107

111-
10. **Add release notes**
108+
9. **Add release notes**
112109

113110
Add a short summary of important changes since the previous stable
114111
release. This should be similar to what has been logged in `CHANGELOG.md`.
115112
Then click the "Generate release notes" button to auto-generate
116113
contributor information.
117114

118-
11. **Optional: Thank contributors**
115+
10. **Optional: Thank contributors**
119116

120117
You can optionally include any particular thank-yous to contributors or
121118
reviewers in a note at the bottom of the release.
122119

123-
12. **Publish the release**
120+
11. **Publish the release**
124121

125122
Click the "Publish release" button.
126123

127-
13. **Verify CI/CD**
124+
12. **Verify CI/CD**
128125

129126
If [the CI][ci] run is [successful][actions],
130127
then the release will be published on both

0 commit comments

Comments
 (0)