ci: build windows

This commit is contained in:
liwei committed 2022-11-02 21:58:34 +08:00
1 parent 39aec19471
commit be75b50521
7 files changed
+125 -40

No files matched your search

+75 -34
View File
@@ -25,39 +25,81 @@ jobs:
id: create_release id: create_release
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# build-cli: build-windows:
# runs-on: ubuntu-latest runs-on: windows-latest
# needs: [ release ] needs: [ release ]
# steps: steps:
# - uses: actions/checkout@v3 - uses: actions/checkout@v3
# - uses: actions/setup-go@v3 - uses: actions/setup-go@v3
# with: with:
# go-version: '^1.19' go-version: '^1.19'
# cache: true cache: true
# - name: Build - uses: subosito/flutter-action@v2
# env: - name: Build
# VERSION: ${{ needs.release.outputs.tag_name }} env:
# run: | VERSION: ${{ needs.release.outputs.tag_name }}
# mkdir -p dist/zip run: |
# goos_arr=(windows darwin linux) go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/monkeyWie/gopeed/bind/desktop
# goarch_arr=(386 amd64 arm64) cd ui/flutter
# export CGO_ENABLED=0 flutter build windows
# for goos in "${goos_arr[@]}"; do cd build/windows
# for goarch in "${goarch_arr[@]}"; do echo @"
# dir="dist/gopeed-$VERSION-$goos-$goarch/" ; Script generated by the Inno Setup Script Wizard.
# (GOOS=$goos GOARCH=$goarch go build -tags nosqlite -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/gopeed \ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
# && cd $dir \
# && zip -r ../zip/gopeed-cli-$VERSION-$goos-$goarch.zip * \ #define MyAppName "Gopeed"
# && cd ../..) \ #define MyAppVersion "$env:VERSION.substring(1)"
# || true #define MyAppPublisher "monkeyWie"
# done #define MyAppURL "https://gopeed.com"
# done #define MyAppExeName "gopeed.exe"
# - name: Upload
# uses: shogo82148/actions-upload-release-asset@v1 [Setup]
# with: ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
# upload_url: ${{ needs.release.outputs.upload_url }} ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
# asset_path: dist/zip/* AppId={{5960F34D-1E42-402C-8C85-DE2FF24CBAE4}
# overwrite: true AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\gopeed
DisableProgramGroupPage=yes
LicenseFile=..\..\..\..\LICENSE
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
OutputBaseFilename=gopeed
SetupIconFile=..\..\assets\icon\icon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: ".\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
"@ > setup.iss
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "setup.iss"
mv "Output\setup.exe" "gopeed-$env:VERSION-windows-amd64.exe"
- name: Upload
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ui/flutter/build/windows/Output/*
overwrite: true
build-macos-arm64-lib: build-macos-arm64-lib:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ release ] needs: [ release ]
@@ -114,7 +156,6 @@ jobs:
PROJECT_DIR=$(pwd) PROJECT_DIR=$(pwd)
cd ui/flutter cd ui/flutter
flutter config --enable-macos-desktop
flutter build macos flutter build macos
cd build/macos/Build/Products/Release cd build/macos/Build/Products/Release
cat>appdmg.json<<EOF cat>appdmg.json<<EOF
+10 -2
View File
@@ -43,9 +43,17 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# Libgopeed # Libgopeed
android/app/libs/libgopeed.aar windows/libgopeed.h
android/app/libs/libgopeed-sources.jar windows/libgopeed.dll
macos/Frameworks/libgopeed.h macos/Frameworks/libgopeed.h
macos/Frameworks/libgopeed.dylib macos/Frameworks/libgopeed.dylib
linux/bundle/lib/libgopeed.h
linux/bundle/lib/libgopeed.dylib
android/app/libs/libgopeed.aar
android/app/libs/libgopeed-sources.jar
debian/packages debian/packages
generated_plugin_registrant.cc
generated_plugin_registrant.h
generated_plugins.cmake
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@@ -70,14 +70,17 @@ class LibgopeedBootNative implements LibgopeedBoot {
} }
_ffiInit() { _ffiInit() {
var libName = "libgopeed.";
if (Platform.isWindows) {
libName += "dll";
}
if (Platform.isMacOS) { if (Platform.isMacOS) {
_libgopeed = libName += "dylib";
LibgopeedFFi(LibgopeedBind(DynamicLibrary.open('libgopeed.dylib')));
} }
if (Platform.isLinux) { if (Platform.isLinux) {
_libgopeed = libName += "so";
LibgopeedFFi(LibgopeedBind(DynamicLibrary.open('libgopeed.so')));
} }
_libgopeed = LibgopeedFFi(LibgopeedBind(DynamicLibrary.open(libName)));
} }
// FFI run in isolate // FFI run in isolate
+21
View File
@@ -141,6 +141,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.16.0" version: "1.16.0"
console:
dependency: transitive
description:
name: console
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.0"
context_menus: context_menus:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -326,6 +333,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.6.5" version: "4.6.5"
get_it:
dependency: transitive
description:
name: get_it
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.2.0"
glob: glob:
dependency: transitive dependency: transitive
description: description:
@@ -480,6 +494,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.2" version: "1.0.2"
msix:
dependency: "direct dev"
description:
name: msix
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.7.0"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
+9
View File
@@ -67,6 +67,7 @@ dev_dependencies:
git: git:
url: https://github.com/fluttercommunity/flutter_launcher_icons.git url: https://github.com/fluttercommunity/flutter_launcher_icons.git
ref: v0.11.0 ref: v0.11.0
msix: ^3.7.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
@@ -123,6 +124,14 @@ flutter_icons:
generate: true generate: true
image_path: "assets/icon/icon_macos_1024.png" image_path: "assets/icon/icon_macos_1024.png"
msix_config:
display_name: Gopeed
publisher_display_name: gopeed.com
identity_name: com.gopeed
logo_path: assets/icon/icon_1024.png
capabilities: privateNetworkClientServer
install_certificate: false
ffigen: ffigen:
name: LibgopeedBind name: LibgopeedBind
description: Bindings to gopeed library. description: Bindings to gopeed library.
+3
View File
@@ -80,6 +80,9 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime) COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/libgopeed.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
if(PLUGIN_BUNDLED_LIBRARIES) if(PLUGIN_BUNDLED_LIBRARIES)
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"