Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
RealChuan committed May 22, 2024
1 parent a8365a0 commit 28fbfb0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions packaging/macos/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 6 additions & 7 deletions packaging/ubuntu/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
2 changes: 1 addition & 1 deletion packaging/windows/app.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions packaging/windows/package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ foreach ($file in $allFiles) {
}
}

# packaging with iscc
ISCC (Join-Path $PSScriptRoot "app.iss")

$Remove_List_Relative = @(
"*Test*",
"*plugin*.dll",
Expand All @@ -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

0 comments on commit 28fbfb0

Please sign in to comment.