File tree Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Original file line number Diff line number Diff line change 1
- name : Build and Publish Package (for open-dingtalk)
1
+ name : Build and Publish Package
2
2
on :
3
- push :
4
- branches :
5
- - main
3
+ release :
4
+ types : [published]
6
5
jobs :
7
6
build-and-publish :
8
7
runs-on : ubuntu-latest
9
8
steps :
10
9
- name : Checkout
11
10
uses : actions/checkout@v2
12
- - name : Check Commit Message
13
- id : check_commit_message
14
- run : |
15
- VERSION=$(python setup.py --version)
16
- echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
17
- if [[ $(git log -1 --pretty='format:%B' ${{ github.sha }}) == *"release"* ]] && [[ "${{ github.repository_owner }}" == "open-dingtalk" ]]; then
18
- echo "build_package=true" >> $GITHUB_OUTPUT
19
- else
20
- echo "build_package=false" >> $GITHUB_OUTPUT
21
- fi
22
- - name : Debug Github Output
23
- run : |
24
- echo ${{ steps.check_commit_message.outputs.build_package }}
25
11
- name : Build Package
26
- if : ${{ steps.check_commit_message.outputs.build_package }} == 'true'
27
12
run : |
28
13
python setup.py sdist bdist_wheel
29
14
- name : Publish Package
30
- if : ${{ steps.check_commit_message.outputs.build_package }} == 'true'
31
15
uses : pypa/gh-action-pypi-publish@master
32
16
with :
33
17
user : __token__
34
18
password : ${{ secrets.PYPI_API_TOKEN }}
35
- - name : Tag this Commit
36
- id : tag_version
37
- if : github.ref == 'refs/heads/master' && ${{ steps.check_commit_message.outputs.build_package }} == 'true'
38
- uses :
mathieudutour/[email protected]
39
- with :
40
- custom_tag : ${{ steps.check_commit_message.outputs.version }}
41
- github_token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments