Merge pull request #571 from deepmodeling/release-please--branches--m… #264
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python distributions to PyPI | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'VERSION' | |
jobs: | |
build-n-publish: | |
if: github.repository_owner == 'deepmodeling' | |
name: Build and publish Python distributions to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@master | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@master | |
with: | |
python-version: 3.9 | |
- name: Install pypa/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
verbose: true | |
- name: read version | |
id: read | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: ./VERSION | |
- name: send email | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp.feishu.cn | |
server_port: 465 | |
username: ${{ secrets.MAILUSERNAME }} | |
password: ${{ secrets.MAILPASSWORD }} | |
subject: PyPI Auto Build For Dflow | |
body: Distribution has been published to https://pypi.org/project/pydflow/${{ steps.read.outputs.content }}/ | |
to: ${{ secrets.MAIL_RECEIVER_LIST }} | |
from: Github Actions | |
content_type: text |