Skip to content

Commit c19fb91

Browse files
committed
[Docs] (docs) Add section of new reusable workflow 'push_pkg_to_pypi.yaml'.
1 parent bf17a1d commit c19fb91

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The usage of each workflow template.
3232
* [_upload_test_cov_report.yaml_](#upload_test_cov_reportyaml)
3333
* [_pre-building_test.yaml_](#pre-building_testyaml)
3434
* [_build_git-tag_and_create_github-release.yaml_](#build_git-tag_and_create_github-releaseyaml)
35+
* [_push_pkg_to_pypi.yaml_](#push_pkg_to_pypiyaml)
3536

3637
<hr>
3738

@@ -341,3 +342,44 @@ The badge it generates:
341342
342343
[![Release](https://img.shields.io/github/release/Chisanan232/GitHub-Action-Template-Python.svg?label=Release&logo=github)](https://github.com/Chisanan232/GitHub-Action-Template-Python/releases)
343344
345+
<hr>
346+
347+
### _push_pkg_to_pypi.yaml_
348+
349+
* Description: Compile source code and push the Python package to PyPI. (Official release the Python package)
350+
* Options:
351+
352+
It has 2 different types option could use:
353+
354+
_General option_:
355+
356+
| option name | data type | optional or required | function content |
357+
|--------------|-----------|-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
358+
| release-type | string | Required | The type of release processing. It has 2 type options: 'Official-Release' or 'Pre-Release'. It won't push the package to PyPI if it's 'Pre-Release'. |
359+
| push-to-PyPI | string | Optional, Default value is _empty string_ | Push Python package to official PyPI or test PyPI. It has 2 type options: 'official' or 'test'. |
360+
361+
_Secret option_:
362+
363+
| option name | option is optional or required | function content |
364+
|-------------|--------------------------------|-----------------------------|
365+
| PyPI_user | Required | The username of PyPI. |
366+
| PyPI_token | Required | The password token of PyPI. |
367+
368+
* Output:
369+
370+
No, nothing at all.
371+
372+
* How to use it?
373+
374+
```yaml
375+
push_python_pkg_to_pypi:
376+
# name: Upload the Python package files which has been compiled to PyPi
377+
uses: ./.github/workflows/push_pkg_to_pypi.yaml
378+
with:
379+
release-type: 'Official-Release'
380+
push-to-PyPI: test
381+
secrets:
382+
pypi_user: ${{ secrets.PYPI_USERNAME }}
383+
pypi_token: ${{ secrets.PYPI_PASSWORD }}
384+
```
385+

0 commit comments

Comments
 (0)