Files
Onekey/.github/workflows/release.yml
ikun0014 3f4d327f6e 修复Nuitka编译未包含icon.jpg的问题
在dev.yml和release.yml的编译步骤中,新增--include-data-file参数,确保icon.jpg被正确打包进可执行文件,避免因缺失图标文件导致的运行异常。
2025-10-12 17:04:49 +08:00

75 lines
2.7 KiB
YAML

name: Build
on:
workflow_dispatch:
jobs:
build:
permissions:
contents: write
runs-on: windows-latest
steps:
- name: 拉取仓库
uses: actions/checkout@v4
- name: 获取版本
shell: powershell
run: |
$version = (Get-Content package.json | ConvertFrom-Json).version
echo "PACKAGE_VERSION=$version" >> $env:GITHUB_ENV
- name: 安装Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: 安装依赖
run: |
python -m pip install --upgrade pip
pip install imageio
pip install -r requirements.txt
pip install nuitka
- name: 编译
run: |
python -m nuitka --standalone --onefile --assume-yes-for-downloads --show-memory --show-progress --onefile-tempdir-spec="%TEMP%\\onekey_%PID%_%TIME%" --windows-icon-from-ico="icon.jpg" --company-name="ikunshare" --product-name="Onekey" --file-version="${{ env.PACKAGE_VERSION }}" --product-version="${{ env.PACKAGE_VERSION }}" --file-description="Onekey Depot Manifest Downloader." --copyright="Copyright © 2025 ikunshare All Rights Reserved." --include-data-dir="web=web" --output-dir="build" --output-filename="Onekey_v${{ env.PACKAGE_VERSION }}.exe" --include-data-file="./icon.jpg=./icon.jpg" main.py
- name: 创建标签
uses: pkgdeps/git-tag-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
- name: 上传包
uses: actions/upload-artifact@v4
with:
name: Onekey_v${{ env.PACKAGE_VERSION }}.exe
path: build/Onekey_v${{ env.PACKAGE_VERSION }}.exe
- name: 发布
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.PACKAGE_VERSION }}
files: build/Onekey_v${{ env.PACKAGE_VERSION }}.exe
prerelease: false
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 发布到Gitee
uses: nicennnnnnnlee/action-gitee-release@v1.0.5
with:
gitee_owner: ikun0014
gitee_repo: Onekey
gitee_token: ${{ secrets.GITEE_TOKEN }}
gitee_tag_name: v${{ env.PACKAGE_VERSION }}
gitee_release_name: v${{ env.PACKAGE_VERSION }}
gitee_release_body: I don't know
gitee_target_commitish: main
gitee_upload_retry_times: 3
gitee_file_name: Onekey_v${{ env.PACKAGE_VERSION }}.exe
gitee_file_path: build/Onekey_v${{ env.PACKAGE_VERSION }}.exe