File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 name : Deploy and publish
4848 runs-on : ubuntu-latest
4949 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') "
5151 steps :
5252 - name : Setup Extensions
5353 uses : actions/checkout@v2
8181 run : echo "NEXT_RELEASE=$(npx semantic-release --dry-run | grep -oP "Published release \K[0-9]+\.[0-9]+\.[0-9]+")" >> $GITHUB_OUTPUT
8282
8383 - 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