From b9f3b8df363a354b9f6b6c30613055a200d3da8a Mon Sep 17 00:00:00 2001 From: harlanx Date: Sun, 20 Aug 2023 02:49:49 +0800 Subject: [PATCH 1/2] ci: fix msix including the created portable zip This dramatically reduces msix package installer --- .github/workflows/build_windows.yml | 20 +++++++++++--------- inno_setup.iss | 4 ++-- pubspec.yaml | 3 ++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index b3e68e6..b68accb 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -32,20 +32,22 @@ jobs: run: flutter --version - name: Enable windows build run: flutter config --enable-windows-desktop - - name: Create release artifacts + - name: Create release build run: flutter build windows --release - - name: Archive and compress release artifacts + - name: Create portable zip run: | - $outputPath = "build\windows\runner\Release\mkv_profile-${{ env.APP_VERSION }}-windows.zip" - Compress-Archive -Path "build\windows\runner\Release\*" -DestinationPath $outputPath + $outputPath = "build/windows/runner/Outputs/mkv_profile-${{ env.APP_VERSION }}-windows.zip" + Compress-Archive -Path "build/windows/runner/Release/*" -DestinationPath $outputPath + # We already called build so we skip it in msix to reduce work for the runner - name: Create msix installer run: | dart run msix:create ` + --build-windows=false ` --certificate-password=${{ secrets.CERTIFICATE_PASSWORD }} ` --certificate-path=${{ github.workspace }}/keys/CERTIFICATE.pfx ` - --output-path=build/windows/runner/Release ` + --output-path=build/windows/runner/Outputs ` --output-name=mkv_profile-${{env.APP_VERSION}}-windows - - name: Create exe installer + - name: Create exe setup installer run: | "%ProgramFiles(x86)%\Inno Setup 6\iscc.exe" ^ /DMyAppVersion="${{ env.APP_VERSION }}" ^ @@ -59,6 +61,6 @@ jobs: tag_name: v${{ env.APP_VERSION }} generate_release_notes: true files: | - build/windows/runner/Release/mkv_profile-${{ env.APP_VERSION }}-windows.zip - build/windows/runner/Release/mkv_profile-${{ env.APP_VERSION }}-setup-windows.exe - build/windows/runner/Release/mkv_profile-${{ env.APP_VERSION }}-windows.msix \ No newline at end of file + build/windows/runner/Outputs/mkv_profile-${{ env.APP_VERSION }}-windows.zip + build/windows/runner/Outputs/mkv_profile-${{ env.APP_VERSION }}-setup-windows.exe + build/windows/runner/Outputs/mkv_profile-${{ env.APP_VERSION }}-windows.msix \ No newline at end of file diff --git a/inno_setup.iss b/inno_setup.iss index 669a904..45a06c2 100644 --- a/inno_setup.iss +++ b/inno_setup.iss @@ -21,7 +21,7 @@ DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest -OutputDir={#SourcePath}\build\windows\runner\Release +OutputDir={#SourcePath}\build\windows\runner\Outputs OutputBaseFilename=mkv_profile-{#MyAppVersion}-setup-windows SetupIconFile={#SourcePath}\windows\runner\resources\app_icon.ico Compression=lzma @@ -36,7 +36,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ [Files] Source: "{#SourcePath}\build\windows\runner\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#SourcePath}\build\windows\runner\Release\*"; DestDir: "{app}"; Excludes: "*.zip,*.msix"; Flags: ignoreversion +Source: "{#SourcePath}\build\windows\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion Source: "{#SourcePath}\build\windows\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files diff --git a/pubspec.yaml b/pubspec.yaml index e3dedb7..8915713 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,4 +105,5 @@ msix_config: # Refer to https://docs.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations capabilities: "videosLibrary,documentsLibrary,codeGeneration" # Don't publish to Microsoft Store - store: false \ No newline at end of file + store: false + windows_build_args: --obfuscate --split-debug-info=build/windows/runner/Debug \ No newline at end of file From 34bcf4f9a6da2547dcfe5dcb3e7fe3c73b0cf984 Mon Sep 17 00:00:00 2001 From: harlanx Date: Sun, 20 Aug 2023 03:00:48 +0800 Subject: [PATCH 2/2] ci: obfuscate and split debug info in build runner --- .github/workflows/build_windows.yml | 2 +- pubspec.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index b68accb..f7d58a6 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -33,7 +33,7 @@ jobs: - name: Enable windows build run: flutter config --enable-windows-desktop - name: Create release build - run: flutter build windows --release + run: flutter build windows --release --obfuscate --split-debug-info=build/windows/runner/Outputs/symbols - name: Create portable zip run: | $outputPath = "build/windows/runner/Outputs/mkv_profile-${{ env.APP_VERSION }}-windows.zip" diff --git a/pubspec.yaml b/pubspec.yaml index 8915713..e3dedb7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,5 +105,4 @@ msix_config: # Refer to https://docs.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations capabilities: "videosLibrary,documentsLibrary,codeGeneration" # Don't publish to Microsoft Store - store: false - windows_build_args: --obfuscate --split-debug-info=build/windows/runner/Debug \ No newline at end of file + store: false \ No newline at end of file