添加自动发布到pypi的github action

This commit is contained in:
xaoyo 2023-10-28 19:26:16 +08:00
parent 178e11f20b
commit 4f47bcefa6
7 changed files with 63 additions and 5 deletions

54
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: PublishPYPI
on:
# 当master分支有push时触发action
push:
tags:
- 'v*' # 以 'v' 开头的标签触发工作流程
jobs:
publish:
name: Publish Pypi
if: github.repository == 'xaoyaoo/PyWxDump' && contains(github.ref, 'tags/v') # 仅在指定仓库的 tag 触发工作流程
# 此作业在 Linux 上运行
runs-on: windows-latest
steps:
- name: Checkout repository # 检出仓库
uses: actions/checkout@v2 # 使用 GitHub 官方的 checkout action
- run: |
git fetch --prune --unshallow
- name: Set up Python # 设置 Python 环境
uses: actions/setup-python@v2 # 使用 GitHub 官方的 setup-python action
with:
python-version: 3.8 # 指定 Python 版本 (3.8)
- name: Install dependencies # 安装依赖
run: |
python -m pip install -U pip
python -m pip install --upgrade twine
pip install .
- name: Build package # 构建包
run: python setup.py sdist bdist_wheel # 构建 wheel 和 sdist 包
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1 # 使用 PyPA 的 action
with:
user: __token__ # 使用 GitHub Token 进行身份验证
password: ${{ secrets.PYPI_TOKEN }} # 设置 GitHub Token 密钥
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Update PyWxDump
draft: false
prerelease: false

View File

@ -8,14 +8,16 @@
[![GitHub issues](https://img.shields.io/github/issues/xaoyaoo/PyWxDump)](https://github.com/xaoyaoo/PyWxDump/issues)
[![PyPI](https://img.shields.io/pypi/v/pywxdump)](https://pypi.org/project/pywxdump/)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/pywxdump)](https://pypi.org/project/pywxdump/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pywxdump)](https://pypi.org/project/pywxdump/)
[![Wheel](https://img.shields.io/pypi/wheel/pywxdump)](https://pypi.org/project/pywxdump/)
[![PyPI-Downloads](https://img.shields.io/pypi/dm/pywxdump)](https://pypi.org/project/pywxdump/)
[![GitHub license](https://img.shields.io/pypi/l/pywxdump)](https://github.com/xaoyaoo/PyWxDump/blob/master/LICENSE)
[![AutoPyPI](https://github.com/xaoyaoo/PyWxDump/workflows/PublishPYPI/badge.svg)](https://pypi.org/project/pywxdump/)
<details>
<summary><strong>更新日志(点击展开)</strong></summary>
* 2023.10.28 添加自动发布到pypi的github action
* 2023.10.28 修复3.9.5.91版本的偏移
* 2023.10.24 add auto get bias addr ,not need input key or wx folder path.
* 2023.10.17 add LICENSE
* 2023.10.16 添加"3.9.7.15"版本的偏移[#12](https://github.com/xaoyaoo/PyWxDump/issues/12)

View File

@ -1,3 +1,5 @@
setuptools
wheel
psutil
pycryptodomex
pywin32

2
tests/test_cmd.cmd Normal file
View File

@ -0,0 +1,2 @@
pip install -U pywxdump
wxdump -h

View File

@ -1,2 +0,0 @@
pip install pywxdump
wxdump -h