Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
qt_ver:
description: 'qt version'
required: false
default: '6.9.1'
default: '6.9.2'
type: string

runs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
# ISO Langusge Codes: https://cloud.google.com/translate/docs/languages
- name: Adding README - English
uses: dephraiim/translate-readme@main
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
},
"cmake.generator": "Ninja",
"cmake.environment": {
"PATH": "C:\\Qt\\6.9.1\\msvc2022_64\\bin;${env:PATH};"
"PATH": "C:\\Qt\\6.9.2\\msvc2022_64\\bin;${env:PATH};"
}
}
4 changes: 2 additions & 2 deletions cmake/qt.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if(CMAKE_HOST_WIN32)
list(APPEND CMAKE_PREFIX_PATH "C:\\Qt\\6.9.1\\msvc2022_64")
list(APPEND CMAKE_PREFIX_PATH "C:\\Qt\\6.9.2\\msvc2022_64")
elseif(CMAKE_HOST_APPLE)

elseif(CMAKE_HOST_LINUX)
list(APPEND CMAKE_PREFIX_PATH "/opt/Qt/6.9.1/gcc_64")
list(APPEND CMAKE_PREFIX_PATH "/opt/Qt/6.9.2/gcc_64")
endif()

add_definitions(-DQT_DEPRECATED_WARNINGS
Expand Down
2 changes: 1 addition & 1 deletion packaging/macos/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

build_list = [
{
"qmake": r"/Users/runner/Qt/6.9.1/macos/bin/qmake",
"qmake": r"/Users/runner/Qt/6.9.2/macos/bin/qmake",
"qmake_params": r'"CONFIG+=qtquickcompiler"',
"make": r"make",
"project": r"/Users/runner/code/Qt-App/Qt-App.pro",
Expand Down
42 changes: 0 additions & 42 deletions packaging/macos/package.py

This file was deleted.

6 changes: 3 additions & 3 deletions packaging/macos/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project_root=$PWD
echo "Project root: ${project_root}"

echo "Start compiling..."
qmake="/Users/runner/Qt/6.9.1/macos/bin/qmake"
qmake="/Users/runner/Qt/6.9.2/macos/bin/qmake"
build_dir="${project_root}/build/Desktop_Qt_6_8_1_macosbit-Release"

rm -rf ${build_dir}
Expand All @@ -29,7 +29,7 @@ cp -af -v ${project_root}/bin-64/Release/Qt-App.app ${packet_dir}/
delete_file_or_dir "${release_dir}/Qt-App.app"

# deploy Qt-App
macdeployqt="/Users/fxy/Qt/6.9.1/macos/bin/macdeployqt"
macdeployqt="/Users/fxy/Qt/6.9.2/macos/bin/macdeployqt"
${macdeployqt} ${packet_dir}/Qt-App.app -always-overwrite
cp -af -v ${packet_dir}/Qt-App.app ${release_dir}/

Expand Down Expand Up @@ -94,5 +94,5 @@ notarize_app "${out_dmg_path}"

source ${project_root}/packaging/activate_venv.sh
cd "$(dirname "$0")"
python ./package.py
python ${project_root}/packaging/upload.py macos_aarch64
deactivate
131 changes: 131 additions & 0 deletions packaging/upload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# -*- coding: utf-8 -*-
"""
通用 SFTP 上传脚本
支持平台:windows_x86、macos_x86_64、macos_aarch64、ubuntu_x86_64、ubuntu_aarch64
用法:
python upload.py windows_x86
python upload.py macos_x86_64
...
"""

import os
import time
import argparse

import utils

# -------------------- 配置区 --------------------
APP_NAME = "Qt-App"
VERSION = "0.0.1"
BUILD_DATE = time.strftime("%Y%m%d", time.localtime())

# 本地 releases 目录
RELEASES_PATH = os.path.join(os.path.dirname(__file__), "releases")

# 远端公共根目录
REMOTE_ROOT = "/mnt/data/homes/admin/packages/qt-app"

# 各平台配置
PLATFORMS = {
"windows_x86": {
"src_file": f"{APP_NAME}_installer.exe",
"dst_tpl": f"{APP_NAME}_{VERSION}_{BUILD_DATE}_x86.exe",
"remote": f"{REMOTE_ROOT}/windows",
},
"macos_x86_64": {
"src_file": f"{APP_NAME}.dmg",
"dst_tpl": f"{APP_NAME}_{VERSION}_{BUILD_DATE}_x86_64.dmg",
"remote": f"{REMOTE_ROOT}/macos/x86_64",
},
"macos_aarch64": {
"src_file": f"{APP_NAME}.dmg",
"dst_tpl": f"{APP_NAME}_{VERSION}_{BUILD_DATE}_aarch64.dmg",
"remote": f"{REMOTE_ROOT}/macos/aarch64",
},
"ubuntu_x86_64": {
"src_file": f"{APP_NAME}.deb",
"dst_tpl": f"{APP_NAME}_{VERSION}_{BUILD_DATE}_x86_64.deb",
"remote": f"{REMOTE_ROOT}/ubuntu/x86_64",
},
"ubuntu_aarch64": {
"src_file": f"{APP_NAME}.deb",
"dst_tpl": f"{APP_NAME}_{VERSION}_{BUILD_DATE}_aarch64.deb",
"remote": f"{REMOTE_ROOT}/ubuntu/aarch64",
},
}

# SFTP 连接信息
SFTP_SERVER = "192.168.1.111"
SFTP_PORT = 22
SFTP_USER = "root"
SFTP_PWD = "123456"
# -------------------- 逻辑区 --------------------


def upload_platform(platform_key: str) -> None:
if platform_key not in PLATFORMS:
raise ValueError(f"未知的 platform_key: {platform_key}")

cfg = PLATFORMS[platform_key]

src_path = os.path.join(RELEASES_PATH, cfg["src_file"])
dst_name = cfg["dst_tpl"]
dst_path = os.path.join(RELEASES_PATH, dst_name)

# 若目标文件已存在,先删除(utils.remove 内部已做存在性检查)
utils.remove(dst_path)
# 重命名
os.rename(src_path, dst_path)

# 生成 update.json
json_path = os.path.join(RELEASES_PATH, "update.json")
utils.generate_json(VERSION, dst_path, dst_name, json_path)

# 上传主安装包
utils.sftp_upload_file(
SFTP_SERVER,
SFTP_PORT,
SFTP_USER,
SFTP_PWD,
dst_path,
f"{cfg['remote']}/{dst_name}",
)

# 上传 update.json
utils.sftp_upload_file(
SFTP_SERVER,
SFTP_PORT,
SFTP_USER,
SFTP_PWD,
json_path,
f"{cfg['remote']}/update.json",
)

print(f"[{platform_key}] 上传完成 ✔")


def main() -> None:
parser = argparse.ArgumentParser(description="通用 SFTP 上传脚本")
parser.add_argument(
"platform",
choices=list(PLATFORMS.keys()),
help="要上传的平台标识",
)
args = parser.parse_args()
upload_platform(args.platform)


if __name__ == "__main__":
main()

# MacOS
# sudo spctl -vvv --assess --type execute /Applications/Qt-App.app
# 输出如下:
# /Applications/Qt-App.app: accepted
# source=Notarized Developer ID
# origin=Developer ID Application: ********(*******)

# Ubuntu
# dpkg -r Qt-App
# dpkg -i Qt-App_0.0.1_20250810.deb
# dpkg -i --force-overwrite Qt-App_0.0.1_20250810.deb
2 changes: 1 addition & 1 deletion packaging/windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

build_list = [
{
"qmake": r"C:\Qt\6.9.1\msvc2022_64\bin\qmake.exe",
"qmake": r"C:\Qt\6.9.2\msvc2022_64\bin\qmake.exe",
"qmake_params": r'"CONFIG+=qtquickcompiler"',
"jom": r"C:\Qt\Tools\QtCreator\bin\jom\jom.exe",
"env_bat": r'C:\"Program Files"\"Microsoft Visual Studio"\2022\Community\VC\Auxiliary\Build\vcvarsall.bat x64',
Expand Down
Loading