Skip to content

Commit bf44bee

Browse files
committed
[Docs + New Feature] (docs) Update the information of README.
1 parent 5b66273 commit bf44bee

File tree

1 file changed

+60
-2
lines changed

1 file changed

+60
-2
lines changed

README.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# GitHub Action - Workflow template for Python library
22

3-
[![Github-Action reusable workflows test (one-test)](https://github.com/Chisanan232/GitHub-Action-Template-Python/actions/workflows/test-reusable-workflows_one-test.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action-Template-Python/actions/workflows/test-reusable-workflows_one-test.yaml)
4-
[![Github-Action reusable workflows test (multi-tests)](https://github.com/Chisanan232/GitHub-Action-Template-Python/actions/workflows/test-reusable-workflows.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action-Template-Python/actions/workflows/test-reusable-workflows.yaml)
53
[![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)
64
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](https://opensource.org/licenses/Apache-2.0)
5+
[![Python project CI Test (one-test)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml)
6+
[![Python project CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml)
7+
[![GitHub Action reusable workflow project CI Test](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml)
78

89

910
This is a GitHub Action workflow template for **_Python library_** project.
@@ -29,6 +30,7 @@ The usage of each workflow template.
2930
* [_run_test_items_via_pytest.yaml_](#run_test_items_via_pytestyaml)
3031
* [_organize_and_generate_test_cov_reports.yaml_](#organize_and_generate_test_cov_reportsyaml)
3132
* [_upload_test_cov_report.yaml_](#upload_test_cov_reportyaml)
33+
* [_build_git-tag_and_create_github-release.yaml_](#build_git-tag_and_create_github-releaseyaml)
3234

3335

3436
### _prepare_test_items.yaml_
@@ -248,3 +250,59 @@ Nothing.
248250
249251
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e8bfcd5830ba4232b45aca7c2d3e6310)](https://www.codacy.com/gh/Chisanan232/GitHub-Action-Template-Python/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Chisanan232/GitHub-Action-Template-Python&utm_campaign=Badge_Grade)
250252
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/e8bfcd5830ba4232b45aca7c2d3e6310)](https://www.codacy.com/gh/Chisanan232/GitHub-Action-Template-Python/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Chisanan232/GitHub-Action-Template-Python&utm_campaign=Badge_Coverage)
253+
254+
<hr>
255+
256+
### _build_git-tag_and_create_github-release.yaml_
257+
258+
* Description: Build a git tag on a specific commit in every git branch. And create GitHub release if current git branch is 'master'.
259+
* Options:
260+
261+
| option name | data type | optional or required | function content |
262+
|-------------------------|-----------|-------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
263+
| project_type | string | Required | Different project type would get the software version info in different way. Currently, it only has 2 options: _python-package_ or _github-action-reusable-workflow_ |
264+
| debug_mode | boolean | Optional, Default value is _false_ | It would run the tasks as log message, doesn't essentially run feature if this option is true. |
265+
| project_name | string | Optional, Default value is _empty string_ | The project name. |
266+
| software_version_format | string | Optional, Default value is _empty string_ | The format of software version. |
267+
268+
* Output:
269+
270+
Yes, it has running result output. It would output the version which could provide after-process to verify what thing it should do, e.g., release or not.
271+
272+
| Workflow output | description |
273+
|-------------------------------------------------|------------------------------------------------------------------------------------------------------|
274+
| python_release_version | Python project release version info. It only has 2 types value: _Official-Release_ or _Pre-Release_. |
275+
| github-action_reusable_workflow_release_version | Python project release version info. |
276+
277+
* How to use it?
278+
279+
* **_Python package_** usage case:
280+
281+
```yaml
282+
build_git-tag_and_create_github-release:
283+
# name: Build git tag and GitHub release if it needs for Python package project
284+
needs: [coveralls_finish, codacy_finish]
285+
uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml
286+
with:
287+
project_type: python-package
288+
project_name: test_gh_workflow
289+
software_version_format: general-3
290+
debug_mode: true
291+
```
292+
293+
* **_GitHub Action reusable workflow_** usage case:
294+
295+
```yaml
296+
build_git-tag_and_create_github-release:
297+
# name: Build git tag and GitHub release if it needs for GitHub Action reusable workflow project
298+
needs: [coveralls_finish, codacy_finish]
299+
uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml
300+
with:
301+
project_type: github-action-reusable-workflow
302+
debug_mode: true
303+
```
304+
305+
The badge it generates:
306+
307+
[![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)
308+

0 commit comments

Comments
 (0)