-
Notifications
You must be signed in to change notification settings - Fork 69
Codex/modernize pyside6 uv #58
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: master
Are you sure you want to change the base?
Changes from all commits
6a2e641
dfeaf5c
d3b93eb
d985f8c
3dcd1a3
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,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| sudo apt-get update | ||
| sudo apt-get install --yes \ | ||
| libdbus-1-3 \ | ||
| libegl1 \ | ||
| libgl1 \ | ||
| libxkbcommon-x11-0 \ | ||
| libxcb-cursor0 \ | ||
| libxcb-xinerama0 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,67 +1,58 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| name: Build linux release | ||||||||||||||||||||||||||||||||||||||||||||
| name: Build Linux release | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||||||||||
| - 'v*' | ||||||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||||||
| types: [ published ] | ||||||||||||||||||||||||||||||||||||||||||||
| - "v*" | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
3
to
9
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. 工作流缺少 concurrency 控制。虽然仅由 tag push 触发,但重复推送 tag 会产生并行构建。建议添加 concurrency 组以自动取消冗余运行。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-22.04 | ||||||||||||||||||||||||||||||||||||||||||||
|
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. deploy 作业未设置 Suggestion:
Suggested change
Comment on lines
12
to
13
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. deploy 作业未设置 timeout-minutes,若构建或测试步骤卡死将无限消耗 runner 资源。建议添加 timeout-minutes: 30。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v3 | ||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||||||||
|
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. actions/checkout@v6 不存在,当前最新主版本为 v4。使用不存在的版本会导致工作流启动时直接失败,阻断整个发布流程。建议改为 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||
| python-version: '3.10' | ||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||
| # install libxcb-xinerama0 to fix "Could not load the Qt platform plugin 'xcb'" | ||||||||||||||||||||||||||||||||||||||||||||
| # https://forum.qt.io/post/610967 | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v6 | ||||||||||||||||||||||||||||||||||||||||||||
|
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. actions/setup-python@v6 不存在,当前最新主版本为 v5。使用不存在的版本会导致工作流启动时直接失败。建议改为 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||
| python-version: "3.10" | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
+23
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. 未配置 uv 缓存,每次运行都会重新下载所有依赖。可在 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Install system and project dependencies | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| sudo apt-get install libxcb-xinerama0 | ||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements.txt | ||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements_build_addon.txt | ||||||||||||||||||||||||||||||||||||||||||||
| bash .github/scripts/install-linux-qt-deps.sh | ||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install uv | ||||||||||||||||||||||||||||||||||||||||||||
| uv sync --locked --group build | ||||||||||||||||||||||||||||||||||||||||||||
|
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.
Suggestion:
Suggested change
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.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Determine Version | ||||||||||||||||||||||||||||||||||||||||||||
| id: get_version | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Test | ||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||
| QT_QPA_PLATFORM: offscreen | ||||||||||||||||||||||||||||||||||||||||||||
| run: uv run pytest -q | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Determine version | ||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| VERSION=$(git describe --tags --always --dirty) | ||||||||||||||||||||||||||||||||||||||||||||
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||
| echo "Version determined: $VERSION" | ||||||||||||||||||||||||||||||||||||||||||||
| echo "__version__ = '${{ env.VERSION }}'" > src/version.py | ||||||||||||||||||||||||||||||||||||||||||||
| cat src/version.py | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Build package | ||||||||||||||||||||||||||||||||||||||||||||
| run: pyinstaller -F run_gui.py -i "pdf.ico" --exclude config.ini --distpath . -n "pdfdir" --noconsole | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Build debug package | ||||||||||||||||||||||||||||||||||||||||||||
| run: pyinstaller -F run_gui.py -i "pdf.ico" --exclude config.ini --distpath . -n "pdfdir_debug" | ||||||||||||||||||||||||||||||||||||||||||||
| echo "VERSION=${VERSION}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||
| echo "__version__ = '${VERSION}'" > src/version.py | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare file | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Build packages | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| chmod +x pdfdir | ||||||||||||||||||||||||||||||||||||||||||||
| zip -r pdfdir_ubuntu.zip pdfdir | ||||||||||||||||||||||||||||||||||||||||||||
| uv run pyinstaller -F run_gui.py -i pdf.ico --add-data "pdf.ico:src" --add-data "src/language:src/language" --distpath . -n pdfdir --noconfirm --clean --noconsole | ||||||||||||||||||||||||||||||||||||||||||||
| uv run pyinstaller -F run_gui.py -i pdf.ico --add-data "pdf.ico:src" --add-data "src/language:src/language" --distpath . -n pdfdir_debug --noconfirm --clean | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare debug file | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare archives | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| chmod +x pdfdir_debug | ||||||||||||||||||||||||||||||||||||||||||||
| zip -r pdfdir_debug_ubuntu.zip pdfdir_debug | ||||||||||||||||||||||||||||||||||||||||||||
| chmod +x pdfdir pdfdir_debug | ||||||||||||||||||||||||||||||||||||||||||||
| zip pdfdir_ubuntu.zip pdfdir | ||||||||||||||||||||||||||||||||||||||||||||
| zip pdfdir_debug_ubuntu.zip pdfdir_debug | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload package | ||||||||||||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v1 | ||||||||||||||||||||||||||||||||||||||||||||
| if: startsWith(github.ref, 'refs/tags/') | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload packages | ||||||||||||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v3 | ||||||||||||||||||||||||||||||||||||||||||||
|
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. softprops/action-gh-release@v3 不存在,当前最新主版本为 v2(v1 已弃用)。使用不存在的版本会导致上传发布产物步骤失败,构建好的包无法发布。建议改为 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||
| files: | | ||||||||||||||||||||||||||||||||||||||||||||
| pdfdir_ubuntu.zip | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,66 +1,56 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build mac release | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build macOS Intel release | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'v*' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| types: [ published ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - "v*" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
3
to
+6
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. 工作流缺少 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: macos-13 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: macos-15-intel | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
12
to
+13
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. deploy 作业缺少 timeout-minutes 设置。若构建或归档步骤卡住,作业将无限运行(默认 6 小时),浪费 runner 资源并阻塞其他作业。建议添加 timeout-minutes: 30。 Suggestion:
Suggested change
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.
Suggestion:
Suggested change
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. 作业缺少 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. actions/checkout 最新版本为 v4,v6 不存在。工作流将在运行第一步时立即失败,导致所有 macOS Intel 发布构建被阻塞。请改为 actions/checkout@v4。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: '3.7' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. actions/setup-python 最新版本为 v5,v6 不存在。工作流将在此步骤失败。请改为 actions/setup-python@v5。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: "3.10" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
+23
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. 依赖安装步骤未利用缓存(如 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements_build_addon.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install Pillow | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install uv | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uv sync --locked --group build | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
25
to
+28
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. uv 依赖安装未配置缓存,每次运行都会重新下载所有 Python 包,增加构建时间和网络故障风险。建议在 setup-python 步骤中添加 cache: 'pip',或使用 actions/cache 缓存 ~/.cache/uv 目录。 Suggestion:
Suggested change
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.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Determine Version | ||||||||||||||||||||||||||||||||||||||||||||||||||
| id: get_version | ||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Test | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| QT_QPA_PLATFORM: offscreen | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: uv run pytest -q | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Determine version | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| VERSION=$(git describe --tags --always --dirty) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Version determined: $VERSION" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "__version__ = '${{ env.VERSION }}'" > src/version.py | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cat src/version.py | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build package | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pyinstaller -D run_gui.py -i "pdf.ico" --exclude config.ini --distpath . -n "pdfdir" --noconsole | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "VERSION=${VERSION}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "__version__ = '${VERSION}'" > src/version.py | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build debug package | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pyinstaller -D run_gui.py -i "pdf.ico" --exclude config.ini --distpath . -n "pdfdir_debug" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build packages | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x pdfdir.app | ||||||||||||||||||||||||||||||||||||||||||||||||||
| zip -r pdfdir_mac.zip pdfdir.app | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uv run pyinstaller -D run_gui.py -i pdf.ico --add-data "pdf.ico:src" --add-data "src/language:src/language" --distpath . -n pdfdir --noconfirm --clean --noconsole | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uv run pyinstaller -D run_gui.py -i pdf.ico --add-data "pdf.ico:src" --add-data "src/language:src/language" --distpath . -n pdfdir_debug --noconfirm --clean | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare debug file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Prepare archives | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| chmod +x pdfdir_debug | ||||||||||||||||||||||||||||||||||||||||||||||||||
| zip -r pdfdir_debug_mac.zip pdfdir_debug | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ditto -c -k --sequesterRsrc --keepParent pdfdir.app pdfdir_mac_intel.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ditto -c -k --sequesterRsrc --keepParent pdfdir_debug pdfdir_debug_mac_intel.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload package | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: startsWith(github.ref, 'refs/tags/') | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload packages | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. softprops/action-gh-release 是第三方 action,仅使用标签 @V3 而非完整 commit SHA。标签可被覆盖,存在供应链安全风险。建议锁定到具体 commit SHA,如 @c95fe14。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| files: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pdfdir_mac.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pdfdir_debug_mac.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pdfdir_mac_intel.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pdfdir_debug_mac_intel.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,57 +1,51 @@ | ||||||||||||||||||||||||||||||||||||||||
| name: Build macos-14 release | ||||||||||||||||||||||||||||||||||||||||
| name: Build macOS Apple Silicon release | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||||||
| - 'v*' | ||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||
| types: [ published ] | ||||||||||||||||||||||||||||||||||||||||
| - "v*" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
8
to
9
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. 工作流缺少 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
11
to
12
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. 缺少并发控制 ( Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| runs-on: macos-14 | ||||||||||||||||||||||||||||||||||||||||
| runs-on: macos-15 | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
12
to
+13
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.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v3 | ||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||||
|
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.
此问题同时存在于 linux-release.yml、mac-release.yml、windows-release.yml 中。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| python-version: '3.10' | ||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Determine Version | ||||||||||||||||||||||||||||||||||||||||
| id: get_version | ||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| VERSION=$(git describe --tags --always --dirty) | ||||||||||||||||||||||||||||||||||||||||
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||
| echo "Version determined: $VERSION" | ||||||||||||||||||||||||||||||||||||||||
| echo "__version__ = '${{ env.VERSION }}'" > src/version.py | ||||||||||||||||||||||||||||||||||||||||
| cat src/version.py | ||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v6 | ||||||||||||||||||||||||||||||||||||||||
|
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.
此问题同时存在于 linux-release.yml、mac-release.yml、windows-release.yml 中。 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| python-version: "3.10" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements.txt | ||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements_build_addon.txt | ||||||||||||||||||||||||||||||||||||||||
| pip install Pillow | ||||||||||||||||||||||||||||||||||||||||
| python -m pip install uv | ||||||||||||||||||||||||||||||||||||||||
| uv sync --locked --group build | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
25
to
+28
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. 未对 uv 依赖进行缓存优化。每次运行都会重新解析和下载所有依赖,可能因网络波动导致构建不稳定。建议利用 uv 的内置缓存机制,在 Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Build package | ||||||||||||||||||||||||||||||||||||||||
| run: pyinstaller -D run_gui.py -i "pdf.ico" --exclude config.ini --distpath . -n "pdfdir" --noconsole | ||||||||||||||||||||||||||||||||||||||||
| - name: Test | ||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||
| QT_QPA_PLATFORM: offscreen | ||||||||||||||||||||||||||||||||||||||||
| run: uv run pytest -q | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Prepare file | ||||||||||||||||||||||||||||||||||||||||
| - name: Determine version | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| VERSION=$(git describe --tags --always --dirty) | ||||||||||||||||||||||||||||||||||||||||
| echo "VERSION=${VERSION}" >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||
| echo "__version__ = '${VERSION}'" > src/version.py | ||||||||||||||||||||||||||||||||||||||||
|
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.
Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Build package | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| chmod +x pdfdir.app | ||||||||||||||||||||||||||||||||||||||||
| zip -r pdfdir_mac_silicon.zip pdfdir.app | ||||||||||||||||||||||||||||||||||||||||
| uv run pyinstaller -D run_gui.py -i pdf.ico --add-data "pdf.ico:src" --add-data "src/language:src/language" --distpath . -n pdfdir --noconfirm --clean --noconsole | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Prepare archive | ||||||||||||||||||||||||||||||||||||||||
| run: ditto -c -k --sequesterRsrc --keepParent pdfdir.app pdfdir_mac_silicon.zip | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Upload package | ||||||||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v1 | ||||||||||||||||||||||||||||||||||||||||
| if: startsWith(github.ref, 'refs/tags/') | ||||||||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v3 | ||||||||||||||||||||||||||||||||||||||||
|
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. 第三方 action Suggestion:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| files: | | ||||||||||||||||||||||||||||||||||||||||
| pdfdir_mac_silicon.zip | ||||||||||||||||||||||||||||||||||||||||
| files: pdfdir_mac_silicon.zip | ||||||||||||||||||||||||||||||||||||||||
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.
工作流由 tag 推送触发,但没有设置
concurrency控制。若短时间内连续推送多个版本标签,可能产生多个并发构建运行,导致资源浪费和潜在的发布产物冲突。建议添加concurrency: release-${{ github.ref }}并设置cancel-in-progress: true,确保同一 tag 只有一个构建在运行。Suggestion: