Skip to content

Commit 6e0edbe

Browse files
authored
Merge pull request #1077 from bact/update-actions-version
Update upload/download-artifact actions to v4
2 parents 779da37 + 1b07d9f commit 6e0edbe

File tree

4 files changed

+78
-37
lines changed

4 files changed

+78
-37
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project
2+
# SPDX-FileType: SOURCE
23
# SPDX-License-Identifier: CC0-1.0
34

45
name: Build and publish to PyPI
56

67
on:
8+
push: # Use together with "[cd build]" commit message
9+
branches:
10+
- dev
11+
pull_request: # Use together with "[cd build]" commit message
12+
branches:
13+
- dev
714
release:
8-
types: [published]
15+
types: [published] # "Publish release" button
16+
workflow_dispatch: # Manual trigger to test wheel build
917

1018
jobs:
1119
echo_github_env:
@@ -66,7 +74,7 @@ jobs:
6674
run: twine check dist/*
6775

6876
- name: Store distributions
69-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7078
with:
7179
path: dist
7280

@@ -77,7 +85,7 @@ jobs:
7785
if: github.event_name == 'release' && github.event.action == 'published'
7886
steps:
7987
- name: Retrieve distributions
80-
uses: actions/download-artifact@v3
88+
uses: actions/download-artifact@v4
8189
with:
8290
name: artifact
8391
path: dist

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
SPDX-FileCopyrightText: 2024 PyThaiNLP Project
3-
SPDX-License-Identifier: Apache-2.0
2+
SPDX-FileCopyrightText: 2025 PyThaiNLP Project
3+
SPDX-FileType: DOCUMENTATION
4+
SPDX-License-Identifier: CC0-1.0
45
---
56

67
# Changelog

CONTRIBUTING.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
SPDX-FileCopyrightText: 2025 PyThaiNLP Project
3+
SPDX-FileType: DOCUMENTATION
4+
SPDX-License-Identifier: CC0-1.0
5+
---
6+
17
# Contributing to PyThaiNLP
28

39
Hi! Thanks for your interest in contributing to [PyThaiNLP](https://github.com/PyThaiNLP/pythainlp).
@@ -7,27 +13,42 @@ Please refer to our [Contributor Covenant Code of Conduct](https://github.com/Py
713
## Issue Report and Discussion
814

915
- Discussion: <https://github.com/PyThaiNLP/pythainlp/discussions>
10-
- GitHub issues (for problems and suggestions): <https://github.com/PyThaiNLP/pythainlp/issues>
11-
- Facebook group (not specific to PyThaiNLP, for Thai NLP discussion in general): <https://www.facebook.com/groups/thainlp>
16+
- GitHub issues (for problems and suggestions):
17+
<https://github.com/PyThaiNLP/pythainlp/issues>
18+
- Facebook group (for general Thai NLP discussion, not specific to PyThaiNLP):
19+
<https://www.facebook.com/groups/thainlp>
1220

1321
## Code
1422

1523
## Code Guidelines
1624

17-
- Follow [PEP8](http://www.python.org/dev/peps/pep-0008/), use [black](https://github.com/ambv/black) with `--line-length` = 79;
18-
- Name identifiers (variables, classes, functions, module names) with meaningful
19-
and pronounceable names (`x` is always wrong);
20-
- Please follow this [naming convention](https://namingconvention.org/python/). For example, global constant variables must be in `ALL_CAPS`;
21-
<img src="https://i.stack.imgur.com/uBr10.png" />
22-
- Write tests for your new features. The test suite is in `tests/` directory. (see "Testing" section below);
25+
- Follow [PEP8][pep8], use [black][black] with `--line-length` = 79;
26+
- Name identifiers (variables, classes, functions, module names)
27+
with meaningful and pronounceable names (`x` is always wrong);
28+
- Please follow this [naming convention][naming].
29+
For example, global constant variables must be in `ALL_CAPS`;
30+
![Naming Convention](https://i.stack.imgur.com/uBr10.png)
31+
- Write tests for your new features. The test suite is in `tests/` directory.
32+
(see "Testing" section below);
2333
- Run all tests before pushing (just execute `tox`) so you will know if your
2434
changes broke something;
25-
- Commented out codes are [dead
26-
codes](http://www.codinghorror.com/blog/2008/07/coding-without-comments.html);
27-
- All `#TODO` comments should be turned into [issues](https://github.com/pythainlp/pythainlp/issues) in GitHub;
28-
- When appropriate, use [f-string](https://www.python.org/dev/peps/pep-0498/)
29-
(use `f"{a} = {b}"`, instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`);
30-
- All text files, including source codes, must end with one empty line. This is [to please git](https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file#5813359) and [to keep up with POSIX standard](https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline).
35+
- Commented out codes are [dead codes][dead-codes];
36+
- All `#TODO` comments should be turned into [issues][issues] in GitHub;
37+
- When appropriate, use [f-string][pep0498]
38+
(use `f"{a} = {b}"`,
39+
instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`);
40+
- All text files, including source codes, must end with one empty line.
41+
This is [to please Git][empty-line] and
42+
[to keep up with POSIX standard][posix].
43+
44+
[pep8]: http://www.python.org/dev/peps/pep-0008/
45+
[black]: https://github.com/ambv/black
46+
[naming]: https://namingconvention.org/python/
47+
[pep0498]: https://www.python.org/dev/peps/pep-0498/
48+
[dead-codes]: http://www.codinghorror.com/blog/2008/07/coding-without-comments.html
49+
[issues]: https://github.com/pythainlp/pythainlp/issues
50+
[empty-line]: https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file#5813359
51+
[posix]: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
3152

3253
### Version Control System
3354

@@ -42,12 +63,13 @@ so it may be a good idea to familiarize yourself with it.
4263

4364
### Pull Request
4465

45-
- We use the famous [gitflow](http://nvie.com/posts/a-successful-git-branching-model/)
46-
to manage our branches.
66+
- We use the famous [gitflow][] to manage our branches.
4767
- When you create pull requests on GitHub, GitHub Actions will run tests
4868
and several checks automatically. Click the "Details" link at the end of
4969
each check to see what needs to be fixed.
5070

71+
[gitflow]: http://nvie.com/posts/a-successful-git-branching-model/
72+
5173
## Documentation
5274

5375
- We use [Sphinx](https://www.sphinx-doc.org/en/master/) to generate API document
@@ -131,9 +153,7 @@ See more in [tests/README.md](./tests/README.md)
131153

132154
## Credits
133155

134-
<a href="https://github.com/PyThaiNLP/pythainlp/graphs/contributors">
135-
<img src="https://contributors-img.firebaseapp.com/image?repo=PyThaiNLP/pythainlp" />
136-
</a>
156+
[![Contributors](https://contributors-img.firebaseapp.com/image?repo=PyThaiNLP/pythainlp)](https://github.com/PyThaiNLP/pythainlp/graphs/contributors)
137157

138158
Thanks to all [contributors](https://github.com/PyThaiNLP/pythainlp/graphs/contributors). (Image made with [contributors-img](https://contributors-img.firebaseapp.com))
139159

release.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
1+
---
2+
SPDX-FileCopyrightText: 2025 PyThaiNLP Project
3+
SPDX-FileType: DOCUMENTATION
4+
SPDX-License-Identifier: CC0-1.0
5+
---
6+
17
# How to cut a new release
28

3-
0. This project follows [semantic versioning][semver].
4-
1. Ensure the version and release date fields (if any) in these files
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 release. For example, deprecation or termination of support.
13+
2. This project follows [semantic versioning][semver].
14+
Ensure the version and release date fields (if any) in these files
515
have been updated to the version of the new planned release:
16+
- `codemeta.json`
617
- `pyproject.toml`
718
- `setup.cfg`
819
- `setup.py`
20+
- `CHANGELOG.md`
921
- `CITATION.cff`
1022
- `README.md`
1123
- `README.TH.md`
12-
- `CHANGELOG.md`
13-
- `codemeta.json`
14-
2. Navigate to the
15-
[releases page][releases] and
16-
click the "Draft a new release" button.
24+
3. Navigate to the [releases page][releases] and click the
25+
"Draft a new release" button.
1726
Only project maintainers are able to perform this step.
18-
3. Then enter the new tag in the "Choose a tag" box.
27+
4. Then enter the new tag in the "Choose a tag" box.
1928
The tag should begin with "v", as in, for instance, `v5.0.1`.
20-
4. The release title should be the same as the new version tag.
29+
5. The release title should be the same as the new version tag.
2130
For instance, the title could be `v5.0.1`.
22-
5. The click the "Generate release notes" button.
23-
6. You can optionally include any particular thank-you's to contributors or
31+
6. Add a short summary of important changes in this release.
32+
_This should be similar to what have been logged in `CHANGELOG.md`._
33+
Then click the "Generate release notes" button.
34+
7. You can optionally include any particular thank-you's to contributors or
2435
reviewers in a note at the bottom of the release.
25-
7. You can then click "publish release."
26-
8. If [the CI][ci] run is [successful][actions], then the release will be published on both
36+
8. You can then click "Publish release" button.
37+
9. If [the CI][ci] run is [successful][actions],
38+
then the release will be published on both
2739
the GitHub release page and also the [Python Package Index][pypi].
2840

2941
[semver]: https://semver.org/

0 commit comments

Comments
 (0)