-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.72 KB
/
cd.yaml
File metadata and controls
45 lines (39 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: CD
on:
# Run the deployment about publishing the Python source code to PyPI.
push:
branches:
- "master"
paths:
# This deployment workflow would only be triggered by file change of module *__pkg_info__* because it has the package version info.
# - ".github/workflows/cd.yaml" # For test or emergency scenario only
- "**/__pkg_info__.py"
jobs:
check_version-state:
# name: Check the version update state
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_checking_deployment_state.yaml@v7.3
with:
library-name: fake-api-server
library-source-code-path: ./fake_api_server
build_git-tag_and_create_github-release:
# name: Build git tag and GitHub release if it needs
needs: check_version-state
if: ${{ needs.check_version-state.outputs.version_update_state == 'VERSION UPDATE' }}
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_build_git-tag_and_create_github-release.yaml@v7.3
secrets:
github_auth_token: ${{ secrets.GITHUB_TOKEN }}
with:
project_type: python-package
project_name: fake_api_server
software_version_format: general-3
push_python_pkg_to_pypi:
# name: Check about it could work finely by installing the Python package with setup.py file
needs: build_git-tag_and_create_github-release
uses: Chisanan232/GitHub-Action_Reusable_Workflows-Python/.github/workflows/rw_push_pypi.yaml@v7.3
with:
build-type: poetry
release-type: ${{ needs.build_git-tag_and_create_github-release.outputs.python_release_version }}
push-to-PyPI: official
secrets:
PyPI_user: ${{ secrets.PYPI_USERNAME }}
PyPI_token: ${{ secrets.PYPI_PASSWORD }}