-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 2 KB
/
deploy_sys_2_development.yml
File metadata and controls
54 lines (47 loc) · 2 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
46
47
48
49
50
51
52
53
54
# This workflow deploy system tools to development environment
name: Deploy Sys_Tools
on:
push:
branches: [ "sys_conf", "sys_log", "sys_shd" ]
pull_request_review:
types: [submitted]
branches: [ "sys_conf", "sys_log", "sys_shd" ]
jobs:
build-package-on-push:
if: ${{ github.event_name == 'push'}}
name: Build package ${{ github.ref_name }}
uses: ./.github/workflows/build_python_package.yml
with:
package-name: ${{ github.ref_name }}
package-path: "code/${{ github.ref_name }}"
source-path: "code/${{ github.ref_name }}/src"
python-version: "3.10"
build-package-on-pull-request:
if: ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && contains(fromJson('["sys_conf", "sys_log", "sys_shd"]'), github.event.pull_request.head.ref)}}
name: Build package ${{ github.event.pull_request.head.ref }}
uses: ./.github/workflows/build_python_package.yml
with:
package-name: ${{ github.event.pull_request.head.ref }}
package-path: "code/${{ github.event.pull_request.head.ref }}"
source-path: "code/${{ github.event.pull_request.head.ref }}/src"
python-version: "3.10"
publish-package:
name: Publish package ${{ github.event.pull_request.head.ref }} to PyPi
if: ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved'}}
needs: build-package-on-pull-request
runs-on: ubuntu-latest
environment: development
permissions:
id-token: write
steps:
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: ${{ github.event.pull_request.head.ref }}
path: ${{ github.event.pull_request.head.ref }}/dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ${{ github.event.pull_request.head.ref }}/dist/