1
1
name : PyPI
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ package :
7
+ description : ' Package to be deployed'
8
+ required : true
9
+ default : ' paddlenlp'
10
+ type : choice
11
+ options :
12
+ - paddlenlp
13
+ - paddle-pipelines
14
+ - ppdiffusers
4
15
5
16
jobs :
6
- build :
7
- name : Build
8
- runs-on : ubuntu-20.04
9
- steps :
10
- - uses : actions/checkout@v2
11
- - uses : actions/setup-python@v1
12
- with :
13
- python-version : 3.8
14
- - name : Install dependencies
15
- run : |
16
- python -m pip install --upgrade pip
17
- make install
18
-
19
- ppdiffusers :
20
- name : Pack
21
- needs : build
22
- runs-on : ubuntu-20.04
23
- steps :
24
- - uses : actions/checkout@v2
25
- - uses : actions/setup-python@v1
26
- with :
27
- python-version : 3.8
28
- - name : Install dependencies
29
- run : |
30
- python -m pip install --upgrade pip
31
- pip install setuptools wheel twine
32
- make install-ppdiffusers
33
-
34
- - name : Should Deploy to Pypi Server
35
- id : should-deploy
36
- run : python scripts/should_deploy.py --name ppdiffusers >> $GITHUB_OUTPUT
37
- - name : Check Branch
38
- id : check-branch
39
- run : |
40
- if [[ ${{ github.ref }} =~ ^refs/heads/(develop)$ ]]; then
41
- echo "match=true" >> $GITHUB_OUTPUT
42
- fi # See: https://stackoverflow.com/a/58869470/1123955
43
-
44
- - name : Is A Publish Branch
45
- if : steps.check-branch.outputs.match == 'true' && steps.should-deploy.outputs.should_deploy == 'true'
46
- env :
47
- TWINE_USERNAME : paddle-dev
48
- TWINE_PASSWORD : ${{ secrets.paddlenlp }}
49
- run : |
50
- make deploy-ppdiffusers
51
-
52
- - name : Should Not Deploy To Pypi Server
53
- if : steps.should-deploy.outputs.should_deploy != 'true'
54
- run : echo 'should not deploy pypi server'
55
-
56
- - name : Is Not A Publish Branch
57
- if : steps.check-branch.outputs.match != 'true'
58
- run : echo 'Not A Publish Branch'
59
-
60
- paddle_pipelines :
17
+ Deployment :
61
18
name : Pack
62
19
needs : build
63
20
runs-on : ubuntu-20.04
@@ -70,11 +27,12 @@ jobs:
70
27
run : |
71
28
python -m pip install --upgrade pip
72
29
pip install setuptools wheel twine
73
- make install-paddle-pipelines
30
+ - name : Deploy Package
31
+ id : deploy-package
32
+ env :
33
+ PACKAGE : ${{ inputs.package }}
34
+ run : python scripts/should_deploy.py --name $PACKAGE >> $GITHUB_OUTPUT
74
35
75
- - name : Should Deploy to Pypi Server
76
- id : should-deploy
77
- run : python scripts/should_deploy.py --name paddle-pipelines >> $GITHUB_OUTPUT
78
36
- name : Check Branch
79
37
id : check-branch
80
38
run : |
87
45
env :
88
46
TWINE_USERNAME : paddle-dev
89
47
TWINE_PASSWORD : ${{ secrets.paddlenlp }}
48
+ PACKAGE : ${{ inputs.package }}
90
49
run : |
91
- make deploy-paddle-pipelines
50
+ make deploy-$PACKAGE
92
51
93
52
- name : Should Not Deploy To Pypi Server
94
53
if : steps.should-deploy.outputs.should_deploy != 'true'
0 commit comments