Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,24 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: "Setup Python, Poetry and Dependencaies"
uses: packetcoders/action-setup-cache-python-poetry@main
- name: "Setup Python and uv"
uses: astral-sh/setup-uv@v5
with:
poetry-version: 1.7.1
python-version: 3.12
enable-cache: true
- name: Install dependencies
run: |
poetry install
poetry run python -m pip install pyinstaller==6.22.3
run: uv sync --frozen

- name: Build for Windows
if: matrix.os == 'windows-latest'
run: |
poetry install
poetry run pyinstaller --strip -F -i logo.ico -n ${{ matrix.artifact_name }} main.py
uv run --with pyinstaller==6.22.3 pyinstaller --strip -F -i logo.ico -n ${{ matrix.artifact_name }} main.py
mv dist/${{ matrix.artifact_name }} .

- name: Build for Linux x86_64
if: matrix.os == 'ubuntu-latest'
run: |
poetry install
poetry run pyinstaller --strip -F -n ${{ matrix.artifact_name }} main.py
uv run --with pyinstaller==6.22.3 pyinstaller --strip -F -n ${{ matrix.artifact_name }} main.py
mv dist/${{ matrix.artifact_name }} .

- name: Upload Artifact
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/check_pyproject_and_lock_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
branches: [ main ]
paths:
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
pull_request:
branches: [ main ]
paths:
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
workflow_dispatch: {}


Expand All @@ -25,21 +25,17 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set Up Python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"

- name: Install Dependencies
run: pip install poetry
enable-cache: true

- name: Lock and Check
run: |
poetry lock
poetry check
uv lock
- name: Submit Changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "[AUTO] Lock Poetry Files"
add: "poetry.lock"
message: "[AUTO] Lock uv Files"
add: "uv.lock"
20 changes: 9 additions & 11 deletions .github/workflows/publish_python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ jobs:

- 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: pip install poetry
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Build and Publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry version $(cat version)
poetry build
poetry publish
uv version --no-sync $(cat version)
uv build
uv publish
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# .gitlab-ci.yml
# Python Poetry 项目安全扫描配置
# Python uv 项目安全扫描配置
#
# 功能:
# 1. 扫描 Poetry 项目的依赖文件 poetry.lock
# 1. 扫描 uv 项目的依赖文件 uv.lock
# 2. 生成 SBOM
# 3. 上传至 GitLab 内置 Dependency list
# 4. 上传依赖漏洞至 GitLab 内置 Vulnerability report
Expand Down Expand Up @@ -57,12 +57,12 @@ variables:
#
# SECURE_ANALYZERS_PREFIX: "registry.example.com/analyzers"

# 如果你的 Poetry 项目使用内网 PyPI 源,
# 如果你的 uv 项目使用内网 PyPI 源,
# 建议在 GitLab 项目 Settings > CI/CD > Variables 中配置,
# 不建议直接写死在 yml 中。
#
# PIP_INDEX_URL: "https://pypi.example.com/simple"
# PIP_EXTRA_INDEX_URL: "https://extra-pypi.example.com/simple"
# UV_INDEX_URL: "https://pypi.example.com/simple"
# UV_EXTRA_INDEX_URL: "https://extra-pypi.example.com/simple"

# 覆盖模板中的 dependency-scanning 任务规则
# 让依赖扫描在 MR、默认分支、定时任务中运行
Expand Down
Loading
Loading