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
+126 -41

No files matched your search

+75 -34
View File
@@ -25,39 +25,81 @@ jobs:
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# build-cli:
# runs-on: ubuntu-latest
# needs: [ release ]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v3
# with:
# go-version: '^1.19'
# cache: true
# - name: Build
# env:
# VERSION: ${{ needs.release.outputs.tag_name }}
# run: |
# mkdir -p dist/zip
# goos_arr=(windows darwin linux)
# goarch_arr=(386 amd64 arm64)
# export CGO_ENABLED=0
# for goos in "${goos_arr[@]}"; do
# for goarch in "${goarch_arr[@]}"; do
# dir="dist/gopeed-$VERSION-$goos-$goarch/"
# (GOOS=$goos GOARCH=$goarch go build -tags nosqlite -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/gopeed \
# && cd $dir \
# && zip -r ../zip/gopeed-cli-$VERSION-$goos-$goarch.zip * \
# && cd ../..) \
# || true
# done
# done
# - name: Upload
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ needs.release.outputs.upload_url }}
# asset_path: dist/zip/*
# overwrite: true
build-windows:
runs-on: windows-latest
needs: [ release ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.19'
cache: true
- uses: subosito/flutter-action@v2
- name: Build
env:
VERSION: ${{ needs.release.outputs.tag_name }}
run: |
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/monkeyWie/gopeed/bind/desktop
cd ui/flutter
flutter build windows
cd build/windows
echo @"
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Gopeed"
#define MyAppVersion "$env:VERSION.substring(1)"
#define MyAppPublisher "monkeyWie"
#define MyAppURL "https://gopeed.com"
#define MyAppExeName "gopeed.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5960F34D-1E42-402C-8C85-DE2FF24CBAE4}
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:
runs-on: ubuntu-latest
needs: [ release ]
@@ -114,7 +156,6 @@ jobs:
PROJECT_DIR=$(pwd)
cd ui/flutter
flutter config --enable-macos-desktop
flutter build macos
cd build/macos/Build/Products/Release
cat>appdmg.json<<EOF
+11 -3
View File
@@ -43,9 +43,17 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# Libgopeed
android/app/libs/libgopeed.aar
android/app/libs/libgopeed-sources.jar
windows/libgopeed.h
windows/libgopeed.dll
macos/Frameworks/libgopeed.h
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() {
var libName = "libgopeed.";
if (Platform.isWindows) {
libName += "dll";
}
if (Platform.isMacOS) {
_libgopeed =
LibgopeedFFi(LibgopeedBind(DynamicLibrary.open('libgopeed.dylib')));
libName += "dylib";
}
if (Platform.isLinux) {
_libgopeed =
LibgopeedFFi(LibgopeedBind(DynamicLibrary.open('libgopeed.so')));
libName += "so";
}
_libgopeed = LibgopeedFFi(LibgopeedBind(DynamicLibrary.open(libName)));
}
// FFI run in isolate
+21
View File
@@ -141,6 +141,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.16.0"
console:
dependency: transitive
description:
name: console
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.0"
context_menus:
dependency: "direct main"
description:
@@ -326,6 +333,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
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:
dependency: transitive
description:
@@ -480,6 +494,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
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:
dependency: transitive
description:
+9
View File
@@ -67,6 +67,7 @@ dev_dependencies:
git:
url: https://github.com/fluttercommunity/flutter_launcher_icons.git
ref: v0.11.0
msix: ^3.7.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
@@ -123,6 +124,14 @@ flutter_icons:
generate: true
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:
name: LibgopeedBind
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}"
COMPONENT Runtime)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/libgopeed.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
if(PLUGIN_BUNDLED_LIBRARIES)
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"