Skip to content

Update upload/download-artifact actions to v4 #1077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: CC0-1.0

name: Build and publish to PyPI

on:
push: # Use together with "[cd build]" commit message
branches:
- dev
pull_request: # Use together with "[cd build]" commit message
branches:
- dev
release:
types: [published]
types: [published] # "Publish release" button
workflow_dispatch: # Manual trigger to test wheel build

jobs:
echo_github_env:
Expand Down Expand Up @@ -66,7 +74,7 @@ jobs:
run: twine check dist/*

- name: Store distributions
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: dist

Expand All @@ -77,7 +85,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Retrieve distributions
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
SPDX-FileCopyrightText: 2024 PyThaiNLP Project
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2025 PyThaiNLP Project
SPDX-FileType: DOCUMENTATION
SPDX-License-Identifier: CC0-1.0
---

# Changelog
Expand Down
58 changes: 39 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
SPDX-FileCopyrightText: 2025 PyThaiNLP Project
SPDX-FileType: DOCUMENTATION
SPDX-License-Identifier: CC0-1.0
---

# Contributing to PyThaiNLP

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

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

## Code

## Code Guidelines

- Follow [PEP8](http://www.python.org/dev/peps/pep-0008/), use [black](https://github.com/ambv/black) with `--line-length` = 79;
- Name identifiers (variables, classes, functions, module names) with meaningful
and pronounceable names (`x` is always wrong);
- Please follow this [naming convention](https://namingconvention.org/python/). For example, global constant variables must be in `ALL_CAPS`;
<img src="https://i.stack.imgur.com/uBr10.png" />
- Write tests for your new features. The test suite is in `tests/` directory. (see "Testing" section below);
- Follow [PEP8][pep8], use [black][black] with `--line-length` = 79;
- Name identifiers (variables, classes, functions, module names)
with meaningful and pronounceable names (`x` is always wrong);
- Please follow this [naming convention][naming].
For example, global constant variables must be in `ALL_CAPS`;
![Naming Convention](https://i.stack.imgur.com/uBr10.png)
- Write tests for your new features. The test suite is in `tests/` directory.
(see "Testing" section below);
- Run all tests before pushing (just execute `tox`) so you will know if your
changes broke something;
- Commented out codes are [dead
codes](http://www.codinghorror.com/blog/2008/07/coding-without-comments.html);
- All `#TODO` comments should be turned into [issues](https://github.com/pythainlp/pythainlp/issues) in GitHub;
- When appropriate, use [f-string](https://www.python.org/dev/peps/pep-0498/)
(use `f"{a} = {b}"`, instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`);
- 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).
- Commented out codes are [dead codes][dead-codes];
- All `#TODO` comments should be turned into [issues][issues] in GitHub;
- When appropriate, use [f-string][pep0498]
(use `f"{a} = {b}"`,
instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`);
- All text files, including source codes, must end with one empty line.
This is [to please Git][empty-line] and
[to keep up with POSIX standard][posix].

[pep8]: http://www.python.org/dev/peps/pep-0008/
[black]: https://github.com/ambv/black
[naming]: https://namingconvention.org/python/
[pep0498]: https://www.python.org/dev/peps/pep-0498/
[dead-codes]: http://www.codinghorror.com/blog/2008/07/coding-without-comments.html
[issues]: https://github.com/pythainlp/pythainlp/issues
[empty-line]: https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file#5813359
[posix]: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

### Version Control System

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

### Pull Request

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

[gitflow]: http://nvie.com/posts/a-successful-git-branching-model/

## Documentation

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

## Credits

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

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

Expand Down
38 changes: 25 additions & 13 deletions release.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
---
SPDX-FileCopyrightText: 2025 PyThaiNLP Project
SPDX-FileType: DOCUMENTATION
SPDX-License-Identifier: CC0-1.0
---

# How to cut a new release

0. This project follows [semantic versioning][semver].
1. Ensure the version and release date fields (if any) in these files
0. Check if the package can be built properly.
Include "[cd build]" in the commit message to trigger wheel building.
1. Update `CHANGELOG.md` with a short summary of important changes since
the previous release. For example, deprecation or termination of support.
2. This project follows [semantic versioning][semver].
Ensure the version and release date fields (if any) in these files
have been updated to the version of the new planned release:
- `codemeta.json`
- `pyproject.toml`
- `setup.cfg`
- `setup.py`
- `CHANGELOG.md`
- `CITATION.cff`
- `README.md`
- `README.TH.md`
- `CHANGELOG.md`
- `codemeta.json`
2. Navigate to the
[releases page][releases] and
click the "Draft a new release" button.
3. Navigate to the [releases page][releases] and click the
"Draft a new release" button.
Only project maintainers are able to perform this step.
3. Then enter the new tag in the "Choose a tag" box.
4. Then enter the new tag in the "Choose a tag" box.
The tag should begin with "v", as in, for instance, `v5.0.1`.
4. The release title should be the same as the new version tag.
5. The release title should be the same as the new version tag.
For instance, the title could be `v5.0.1`.
5. The click the "Generate release notes" button.
6. You can optionally include any particular thank-you's to contributors or
6. Add a short summary of important changes in this release.
_This should be similar to what have been logged in `CHANGELOG.md`._
Then click the "Generate release notes" button.
7. You can optionally include any particular thank-you's to contributors or
reviewers in a note at the bottom of the release.
7. You can then click "publish release."
8. If [the CI][ci] run is [successful][actions], then the release will be published on both
8. You can then click "Publish release" button.
9. If [the CI][ci] run is [successful][actions],
then the release will be published on both
the GitHub release page and also the [Python Package Index][pypi].

[semver]: https://semver.org/
Expand Down
Loading