添加自动发布到pypi的github action

This commit is contained in:
xaoyo 2023-10-31 18:43:16 +08:00
parent 3f8bf5d975
commit a4b552f1b4

View File

@ -3,6 +3,8 @@ name: Publish
on: on:
# 当master分支有push时触发action # 当master分支有push时触发action
push: push:
branches:
- master
tags: tags:
- 'v*' # 以 'v' 开头的标签触发工作流程 - 'v*' # 以 'v' 开头的标签触发工作流程
@ -17,7 +19,7 @@ jobs:
- name: Checkout repository # 检出仓库 - name: Checkout repository # 检出仓库
uses: actions/checkout@v2 # 使用 GitHub 官方的 checkout action uses: actions/checkout@v2 # 使用 GitHub 官方的 checkout action
- run: | - run: |
git fetch --prune --unshallow git fetch --prune --unshallow
- name: Set up Python # 设置 Python 环境 - name: Set up Python # 设置 Python 环境
uses: actions/setup-python@v2 # 使用 GitHub 官方的 setup-python action uses: actions/setup-python@v2 # 使用 GitHub 官方的 setup-python action
@ -28,9 +30,7 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install build pip install build
python -m pip install --upgrade twine
- name: Install Twine
run: python -m pip install --upgrade twine
- name: Build package - name: Build package
run: python -m build run: python -m build
@ -51,7 +51,7 @@ jobs:
tag_name: ${{ github.ref }} tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }} release_name: Release ${{ github.ref }}
body: | body: |
Update PyWxDump [Auto Release] Update PyWxDump
draft: false draft: false
prerelease: false prerelease: false