Skip to content

Commit

Permalink
Merge pull request daodao97#8 from adhikasp/win-zip
Browse files Browse the repository at this point in the history
Fix Windows release as zip
  • Loading branch information
daodao97 authored Dec 15, 2024
2 parents 0e3fd07 + 94c16d0 commit b46a86c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
asset_name: chatmcp-macos-x64.dmg
build_target: macos
- os: windows-latest
output_path: build/windows/x64/Runner/Release/chatmcp.exe
asset_name: chatmcp-windows-x64.exe
output_path: build/windows/x64/Runner/Release
asset_name: chatmcp-windows-x64.zip
build_target: windows
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -71,11 +71,12 @@ jobs:
"${{ matrix.asset_name }}" \
"${{ matrix.output_path }}"
- name: Copy Windows Executable
- name: Package Windows App
if: matrix.os == 'windows-latest'
run: |
Copy-Item -Path "build/windows/x64/Runner/Release/chatmcp.exe" -Destination "${{ matrix.asset_name }}"
Copy-Item -Path "windows/sqlite3.dll" -Destination "${{ matrix.output_path }}" -Force
Compress-Archive -Path "${{ matrix.output_path }}/*" -DestinationPath "${{ matrix.asset_name }}" -Force
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/process.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@ Future<Process> startProcess(
args,
environment: env,
includeParentEnvironment: true,
// Windows need it to run properly, no idea why. Keep other platforms as default value (false).
runInShell: Platform.isWindows,
);
}
17 changes: 17 additions & 0 deletions windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,20 @@ install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
CONFIGURATIONS Profile;Release
COMPONENT Runtime)

# Install SQLite3 DLL
find_file(SQLITE3_DLL
NAMES "sqlite3.dll"
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}"
DOC "Path to SQLite3 DLL"
)

if(SQLITE3_DLL)
install(FILES "${SQLITE3_DLL}"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime)
message(STATUS "Found SQLite3 DLL at: ${SQLITE3_DLL}")
else()
message(WARNING "sqlite3.dll not found. The application may not work correctly.")
endif()
Binary file added windows/sqlite3.dll
Binary file not shown.

0 comments on commit b46a86c

Please sign in to comment.