-
Notifications
You must be signed in to change notification settings - Fork 0
Update from task 6fd8db8f-ad29-40d7-9fa3-0c09adcf72dc #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| name: Build and Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version tag (e.g., v1.0.0)' | ||
| required: true | ||
| default: 'v1.0.0' | ||
|
|
||
| jobs: | ||
| build-windows: | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| pip install pyinstaller | ||
|
|
||
| - name: Build Windows executable | ||
| run: | | ||
| pyinstaller --onefile --name "AutoClickerPro" --icon=NONE --add-data "config;config" --add-data "core;core" --add-data "ui;ui" --add-data "utils;utils" main.py | ||
| shell: pwsh | ||
|
|
||
| - name: Create Windows release package | ||
| run: | | ||
| New-Item -ItemType Directory -Force -Path release | ||
| Copy-Item dist\AutoClickerPro.exe release\ | ||
| Copy-Item README.md release\ | ||
| Copy-Item LICENSE release\ 2>$null || echo "No LICENSE file" | ||
| Compress-Archive -Path release\* -DestinationPath AutoClickerPro_Windows.zip -Force | ||
| shell: pwsh | ||
|
|
||
| - name: Upload Windows artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-build | ||
| path: AutoClickerPro_Windows.zip | ||
|
|
||
| build-linux: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| pip install pyinstaller | ||
|
|
||
| - name: Build Linux executable | ||
| run: | | ||
| pyinstaller --onefile --name "AutoClickerPro" --icon=NONE --add-data "config:config" --add-data "core:core" --add-data "ui:ui" --add-data "utils:utils" main.py | ||
|
|
||
| - name: Create Linux release package | ||
| run: | | ||
| mkdir -p release | ||
| cp dist/AutoClickerPro release/ | ||
| cp README.md release/ | ||
| cp LICENSE release/ 2>/dev/null || echo "No LICENSE file" | ||
| cd release && tar -czvf ../AutoClickerPro_Linux.tar.gz * | ||
|
|
||
| - name: Upload Linux artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: linux-build | ||
| path: AutoClickerPro_Linux.tar.gz | ||
|
|
||
| create-release: | ||
| needs: [build-windows, build-linux] | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' | ||
|
|
||
| steps: | ||
| - name: Download Windows artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: windows-build | ||
| path: ./artifacts | ||
|
|
||
| - name: Download Linux artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: linux-build | ||
| path: ./artifacts | ||
|
|
||
| - name: Get version from tag or input | ||
| id: get_version | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
| VERSION="${{ github.event.inputs.version }}" | ||
| else | ||
| VERSION="${{ github.ref_name }}" | ||
| fi | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Generate changelog | ||
| id: changelog | ||
| run: | | ||
| cat > changelog.md << 'EOF' | ||
| ## 🎉 自动点击器专业版 ${{ steps.get_version.outputs.version }} | ||
|
|
||
| ### ✨ 新特性 | ||
| - 🔐 **加密存储**: 宏录制文件采用 Fernet 对称加密,安全保护您的操作序列 | ||
| - 🧩 **模块化架构**: UI 与业务逻辑完全解耦,代码更易维护 | ||
| - ⚡ **高性能**: 优化的线程管理,低延迟响应 | ||
| - 🛡️ **安全防护**: 完整的输入验证和防滥用机制 | ||
| - 🎨 **现代化界面**: 简洁直观的用户体验 | ||
|
|
||
| ### 🔧 技术改进 | ||
| - 分离配置文件 (constants/encryption/validation) | ||
| - 新增宏管理模块 (macros.py) | ||
| - 快捷键管理器 (hotkey_manager.py) | ||
| - 完整的单元测试覆盖 (36+ 测试用例) | ||
| - CI/CD 自动化构建 | ||
|
|
||
| ### 📦 安装说明 | ||
| #### Windows | ||
| 1. 下载 `AutoClickerPro_Windows.zip` | ||
| 2. 解压到任意目录 | ||
| 3. 双击运行 `AutoClickerPro.exe` | ||
|
|
||
| #### Linux | ||
| 1. 下载 `AutoClickerPro_Linux.tar.gz` | ||
| 2. 解压:`tar -xzvf AutoClickerPro_Linux.tar.gz` | ||
| 3. 运行:`./AutoClickerPro` | ||
|
|
||
| ### ⌨️ 快捷键 | ||
| - `F8`: 开始/停止连点 | ||
| - `F9`: 开始/停止录制 | ||
| - `F10`: 播放宏 | ||
| - `ESC`: 停止当前操作 | ||
|
|
||
| ### 📝 更新日志 | ||
| - 首次正式发布 | ||
| - 支持鼠标连点和键盘宏录制 | ||
| - 加密存储保护隐私 | ||
| - 跨平台支持 (Windows/Linux) | ||
| EOF | ||
| cat changelog.md | ||
|
|
||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: 自动点击器专业版 ${{ steps.get_version.outputs.version }} | ||
| body_path: changelog.md | ||
| files: | | ||
|
Comment on lines
+164
to
+167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this workflow is run via Useful? React with 👍 / 👎. |
||
| ./artifacts/AutoClickerPro_Windows.zip | ||
| ./artifacts/AutoClickerPro_Linux.tar.gz | ||
| draft: false | ||
| prerelease: false | ||
| generate_release_notes: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +1,83 @@ | ||
| ``` | ||
| # Python | ||
| # Compiled and build artifacts | ||
| *.pyc | ||
| __pycache__/ | ||
| *.o | ||
| *.obj | ||
| *.class | ||
| *.exe | ||
| *.dll | ||
| *.so | ||
| *.a | ||
| *.out | ||
|
|
||
| # Dependencies | ||
| node_modules/ | ||
| venv/ | ||
| .venv/ | ||
| .env | ||
| .env.local | ||
| .env.* | ||
|
|
||
| # Build directories | ||
| dist/ | ||
| build/ | ||
| target/ | ||
| .gradle/ | ||
|
|
||
| # Python specific | ||
| *.pyc | ||
| __pycache__/ | ||
| *.pyo | ||
| *.pyd | ||
| .Python | ||
| env/ | ||
| venv/ | ||
| .venv/ | ||
| .ENV | ||
| .python-version | ||
|
|
||
| # Testing | ||
| *.so | ||
| .Pytest_cache/ | ||
| .mypy_cache/ | ||
| .coverage | ||
| htmlcov/ | ||
| .coverage.* | ||
| .cache | ||
| .pytest_cache/ | ||
| .hypothesis/ | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
|
|
||
| # IDEs | ||
| # Logs and temp files | ||
| *.log | ||
| *.tmp | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Editors | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Logs | ||
| *.log | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.local | ||
| *.env.* | ||
|
|
||
| # OS generated files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Coverage reports | ||
| coverage/ | ||
| htmlcov/ | ||
| *.coverage | ||
|
|
||
| # Compressed files | ||
| *.zip | ||
| *.gz | ||
| *.tar | ||
| *.tgz | ||
| *.bz2 | ||
| *.xz | ||
| *.7z | ||
| *.rar | ||
| *.zst | ||
| *.lz4 | ||
| *.lzh | ||
| *.cab | ||
| *.arj | ||
| *.rpm | ||
| *.deb | ||
| *.Z | ||
| *.lz | ||
| *.lzo | ||
| *.tar.gz | ||
| *.tar.bz2 | ||
| *.tar.xz | ||
| *.tar.zst | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # -*- mode: python ; coding: utf-8 -*- | ||
|
|
||
|
|
||
| a = Analysis( | ||
| ['main.py'], | ||
| pathex=[], | ||
| binaries=[], | ||
| datas=[], | ||
| hiddenimports=['pynput.mouse', 'pynput.keyboard', 'cryptography.fernet'], | ||
| hookspath=[], | ||
| hooksconfig={}, | ||
| runtime_hooks=[], | ||
| excludes=[], | ||
| noarchive=False, | ||
| optimize=0, | ||
| ) | ||
| pyz = PYZ(a.pure) | ||
|
|
||
| exe = EXE( | ||
| pyz, | ||
| a.scripts, | ||
| a.binaries, | ||
| a.datas, | ||
| [], | ||
| name='AutoClickerPro', | ||
| debug=False, | ||
| bootloader_ignore_signals=False, | ||
| strip=False, | ||
| upx=True, | ||
| upx_exclude=[], | ||
| runtime_tmpdir=None, | ||
| console=True, | ||
| disable_windowed_traceback=False, | ||
| argv_emulation=False, | ||
| target_arch=None, | ||
| codesign_identity=None, | ||
| entitlements_file=None, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In repositories or organizations where the default
GITHUB_TOKENpermission is read-only, this release step will fail with a permissions error because the workflow never requests write access. Thesoftprops/action-gh-releasedocumentation listspermissions: contents: writeas required for the GitHub integration token, so add that at the workflow orcreate-releasejob level before calling the action.Useful? React with 👍 / 👎.