diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1b198e5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 + diff --git a/README.md b/README.md index 10f0f6c..f754b17 100644 --- a/README.md +++ b/README.md @@ -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/)
更新日志(点击展开): +* 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) diff --git a/requirements.txt b/requirements.txt index ef89e6f..6c90d80 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +setuptools +wheel psutil pycryptodomex pywin32 diff --git a/tests/test1.py b/tests/test_1.py similarity index 100% rename from tests/test1.py rename to tests/test_1.py diff --git a/tests/t2.py b/tests/test_2.py similarity index 100% rename from tests/t2.py rename to tests/test_2.py diff --git a/tests/test_cmd.cmd b/tests/test_cmd.cmd new file mode 100644 index 0000000..13b0110 --- /dev/null +++ b/tests/test_cmd.cmd @@ -0,0 +1,2 @@ +pip install -U pywxdump +wxdump -h diff --git a/tests/wxdump_test.cmd b/tests/wxdump_test.cmd deleted file mode 100644 index aee6a9e..0000000 --- a/tests/wxdump_test.cmd +++ /dev/null @@ -1,2 +0,0 @@ -pip install pywxdump -wxdump -h