File tree 1 file changed +23
-2
lines changed
1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 47
47
name : Deploy and publish
48
48
runs-on : ubuntu-latest
49
49
needs : build_test
50
- if : " github.event_name == 'push'"
50
+ if : " github.event_name == 'push' && github.ref == 'refs/heads/master' && !startsWith(github.event.head_commit.message, 'chore') "
51
51
steps :
52
52
- name : Setup Extensions
53
53
uses : actions/checkout@v2
81
81
run : echo "NEXT_RELEASE=$(npx semantic-release --dry-run | grep -oP "Published release \K[0-9]+\.[0-9]+\.[0-9]+")" >> $GITHUB_OUTPUT
82
82
83
83
- name : Publish to git releases and tags
84
- run : echo "The next release is ${{ steps.next_release.outputs.NEXT_RELEASE }}"
84
+ if : ${{ steps.next_release.outputs.NEXT_RELEASE != null }}
85
+ env :
86
+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
87
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88
+ run : |
89
+ echo "The next release is ${{ steps.next_release.outputs.NEXT_RELEASE }}"
90
+ npx semantic-release
91
+
92
+ - name : Build project
93
+ if : ${{ steps.next_release.outputs.NEXT_RELEASE != null }}
94
+ run : |
95
+ pip install -U pip
96
+ pip install build
97
+ python -m build
98
+
99
+ - name : Publish to pypi
100
+ if : ${{ steps.next_release.outputs.NEXT_RELEASE != null }}
101
+ uses : pypa/gh-action-pypi-publish@release/v1
102
+ with :
103
+ user : ${{ secrets.PYPI_USER }}
104
+ password : ${{ secrets.PYPI_PASSWORD }}
105
+ repository_url : https://upload.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments