diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4c49d75..02b3d88 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -126,20 +126,16 @@ jobs: sudo chmod 755 ./packaging/ubuntu/package.sh ./packaging/ubuntu/package.sh - - name: 7z package + - name: Check packages shell: bash run: | ls -al ${{ env.PACKET_DIR }} ls -al ${{ env.RELEASES_DIR }} - CURRENT_DATE=$(date '+%Y%m%d') - filename=Qt-App_${{ runner.os }}_${{ matrix.arch }}_${CURRENT_DATE}.7z - echo "artifactPath=$filename" >> $GITHUB_ENV - 7z a -t7z -r -mx=9 -mmt ${filename} ${{ env.PACKET_DIR }}/* - name: Upload packages uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{matrix.arch}}-${{ matrix.build_type }} - path: ${{ env.artifactPath }} + path: ${{ env.RELEASES_DIR }} release: name: Release diff --git a/packaging/macos/package.sh b/packaging/macos/package.sh index 687cea9..1a92041 100644 --- a/packaging/macos/package.sh +++ b/packaging/macos/package.sh @@ -15,10 +15,16 @@ macdeployqt "${packet_dir}/Qt-App.app" -always-overwrite ls -al "${packet_dir}/Qt-App.app/Contents/Frameworks" +# package with 7z +zip_path="${releases_dir}/Qt-App.7z" +7z a -t7z -r -mx=9 -mmt "${zip_path}" "${packet_dir}/Qt-App.app" + +# package with dmg pip3 install dmgbuild cd "${packet_dir}" dmgbuild -s "${project_dir}/packaging/macos/dmgbuild.py" "Qt-App.app" "Qt-App.dmg" +mv -v "${packet_dir}/Qt-App.dmg" "${releases_dir}" # 排除的文件名 EXCLUDE_FILE="Qt-App.dmg" diff --git a/packaging/ubuntu/package.sh b/packaging/ubuntu/package.sh index bc4c6ff..9b7f536 100644 --- a/packaging/ubuntu/package.sh +++ b/packaging/ubuntu/package.sh @@ -56,8 +56,13 @@ linuxdeployqt ${packet_dir}/Qt-App \ sudo chmod +x *.AppImage cd "${project_dir}" -# Start generate deb package mv -v "${packet_dir}"/*.AppImage "$releases_dir" + +# package with 7z +zip_path="${releases_dir}/Qt-App.7z" +7z a -t7z -r -mx=9 -mmt "${zip_path}" "${packet_dir}"/* + +# package with deb mkdir -p "${project_dir}"/packaging/Qt-App/ mv -v "${packet_dir}"/* "${project_dir}"/packaging/Qt-App mkdir -p "${packet_dir}"/opt @@ -75,10 +80,4 @@ sudo dpkg -b ${packet_dir}/. ${deb_path} sudo chmod -R +x ${releases_dir} -# 清理临时文件 -rm -rf "${packet_dir}"/DEBIAN -rm -rf "${packet_dir}"/usr -mv -v "${packet_dir}"/opt/Qt-App/* "${packet_dir}"/ -rm -rf "${packet_dir}"/opt/Qt-App - echo "Deployment ubuntu completed." diff --git a/packaging/windows/app.iss b/packaging/windows/app.iss index 9d91268..4373471 100644 --- a/packaging/windows/app.iss +++ b/packaging/windows/app.iss @@ -32,7 +32,7 @@ DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest OutputDir=..\releases -OutputBaseFilename={#MyAppName}_installer +OutputBaseFilename={#MyAppName} SetupIconFile=..\..\src\apps\app\app.ico Compression=lzma SolidCompression=yes diff --git a/packaging/windows/package.ps1 b/packaging/windows/package.ps1 index f3a8b4e..d1c4390 100644 --- a/packaging/windows/package.ps1 +++ b/packaging/windows/package.ps1 @@ -25,9 +25,6 @@ foreach ($file in $allFiles) { } } -# packaging with iscc -ISCC (Join-Path $PSScriptRoot "app.iss") - $Remove_List_Relative = @( "*Test*", "*plugin*.dll", @@ -40,6 +37,13 @@ foreach ($item in $Remove_List_Absolute) { Remove-SafeItem -Path $item } +# packaging with 7z +$zip_path = Join-Path $releases_dir "Qt-App.7z" +7z a -t7z -r -mx=9 -mmt $zip_path $packet_dir\* + +# packaging with iscc +ISCC (Join-Path $PSScriptRoot "app.iss") + Write-Host "Packaging complete." exit 0