39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
|
# This workflows will upload a Python Package using Twine when a release is created
|
|||
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|||
|
|
|||
|
# action的名称
|
|||
|
name: Upload Python Package gotwo
|
|||
|
|
|||
|
on:
|
|||
|
# 当master分支有push时,触发action
|
|||
|
push:
|
|||
|
pull_request:
|
|||
|
|
|||
|
jobs:
|
|||
|
deploy:
|
|||
|
name: publish python package to PYPI
|
|||
|
# 此作业在 Linux 上运行
|
|||
|
runs-on: ubuntu-latest
|
|||
|
|
|||
|
steps:
|
|||
|
# 此步骤使用 GitHub 的 https://github.com/actions/checkout
|
|||
|
- uses: actions/checkout@v2
|
|||
|
|
|||
|
# 安装依赖
|
|||
|
- name: Install dependencies
|
|||
|
run: |
|
|||
|
python -m pip install --upgrade pip
|
|||
|
python -m pip install wheel twine
|
|||
|
python -m pip install -r requirements.txt
|
|||
|
|
|||
|
# - name: Test Code
|
|||
|
# run: |
|
|||
|
# ./test.sh
|
|||
|
# 构建和发布
|
|||
|
- name: Build and publish
|
|||
|
env:
|
|||
|
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|||
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|||
|
run: |
|
|||
|
python setup.py sdist bdist_wheel
|
|||
|
twine upload dist/*
|