Added linux to build script, linux compatibility improvements
This commit is contained in:
parent
33f656997c
commit
1f31d51e30
|
|
@ -12,6 +12,11 @@ on:
|
||||||
required: true
|
required: true
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
buildLinux:
|
||||||
|
description: Build for Linux
|
||||||
|
required: true
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
|
|
@ -52,15 +57,13 @@ jobs:
|
||||||
run: flutter build apk --obfuscate --split-debug-info=build/debugAndroid
|
run: flutter build apk --obfuscate --split-debug-info=build/debugAndroid
|
||||||
- name: Preparing files
|
- name: Preparing files
|
||||||
run: |
|
run: |
|
||||||
cp build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/ollama.apk
|
cp build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/ollama-android-v${{ steps.get_flutter_version.outputs.version_number }}.apk
|
||||||
cp build/app/outputs/flutter-apk/app-release.apk.sha1 build/app/outputs/flutter-apk/ollama.apk.sha1
|
|
||||||
- name: Uploading APK
|
- name: Uploading APK
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ollama-android
|
name: ollama-android
|
||||||
path: |
|
path: |
|
||||||
build/app/outputs/flutter-apk/ollama.apk
|
build/app/outputs/flutter-apk/ollama-android-v${{ steps.get_flutter_version.outputs.version_number }}.apk
|
||||||
build/app/outputs/flutter-apk/ollama.apk.sha1
|
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
name: Building for Windows x64
|
name: Building for Windows x64
|
||||||
if: ${{ github.event.inputs.buildWindowsX64 == 'true' }}
|
if: ${{ github.event.inputs.buildWindowsX64 == 'true' }}
|
||||||
|
|
@ -88,12 +91,43 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ollama-windows-x64
|
name: ollama-windows-x64
|
||||||
path: build\windows\x64\runner\ollama-v${{ steps.get_flutter_version.outputs.version_number }}-x64.exe
|
path: build\windows\x64\runner\ollama-windows-x64-v${{ steps.get_flutter_version.outputs.version_number }}.exe
|
||||||
|
build-linux:
|
||||||
|
name: Building for Linux
|
||||||
|
if: ${{ github.event.inputs.buildLinux == 'true' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: analyze
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
flutter-version: 3.22.1
|
||||||
|
- name: Get flutter version
|
||||||
|
id: get_flutter_version
|
||||||
|
uses: its404/get-flutter-version@v1.0.0
|
||||||
|
- name: Disabling flutter analytics
|
||||||
|
run: flutter config --no-analytics
|
||||||
|
- name: Installing linux dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install ninja-build
|
||||||
|
sudo apt-get install build-essential libgtk-3-dev
|
||||||
|
- name: Running build
|
||||||
|
id: compile
|
||||||
|
run: flutter build linux --obfuscate --split-debug-info=build/debugLinux
|
||||||
|
- name: Creating archive
|
||||||
|
run: |
|
||||||
|
cd build/linux/x64/release/bundle
|
||||||
|
tar -czf ollama-linux-x64-v${{ steps.get_flutter_version.outputs.version_number }}.tar.gz *
|
||||||
|
- name: Uploading archive
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ollama-linux-x64
|
||||||
|
path: build/linux/x64/release/bundle/ollama-linux-x64-v${{ steps.get_flutter_version.outputs.version_number }}.tar.gz
|
||||||
bundle:
|
bundle:
|
||||||
name: Creating bundle
|
name: Creating bundle
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
needs: [build-android, build-windows-x64]
|
needs: [build-android, build-windows-x64, build-linux]
|
||||||
steps:
|
steps:
|
||||||
- name: Adding builds
|
- name: Adding builds
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
import 'package:file_selector/file_selector.dart' as file_selector;
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ class _ScreenSettingsExportState extends State<ScreenSettingsExport> {
|
||||||
var content =
|
var content =
|
||||||
jsonEncode(prefs!.getStringList("chats") ?? []);
|
jsonEncode(prefs!.getStringList("chats") ?? []);
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
|
// web fallback
|
||||||
final bytes = utf8.encode(content);
|
final bytes = utf8.encode(content);
|
||||||
final blob = html.Blob([bytes]);
|
final blob = html.Blob([bytes]);
|
||||||
final url = html.Url.createObjectUrlFromBlob(blob);
|
final url = html.Url.createObjectUrlFromBlob(blob);
|
||||||
|
|
@ -64,12 +66,22 @@ class _ScreenSettingsExportState extends State<ScreenSettingsExport> {
|
||||||
html.document.body!.children.remove(anchor);
|
html.document.body!.children.remove(anchor);
|
||||||
html.Url.revokeObjectUrl(url);
|
html.Url.revokeObjectUrl(url);
|
||||||
} else {
|
} else {
|
||||||
var path = await FilePicker.platform.saveFile(
|
String? path = "";
|
||||||
type: FileType.custom,
|
try {
|
||||||
allowedExtensions: ["json"],
|
path = (await file_selector
|
||||||
fileName: name,
|
.getSaveLocation(acceptedTypeGroups: [
|
||||||
bytes: utf8.encode(jsonEncode(
|
const file_selector.XTypeGroup(
|
||||||
prefs!.getStringList("chats") ?? [])));
|
label: "Ollama App File", extensions: ["json"])
|
||||||
|
], suggestedName: name))
|
||||||
|
?.path;
|
||||||
|
} catch (_) {
|
||||||
|
path = await FilePicker.platform.saveFile(
|
||||||
|
type: FileType.custom,
|
||||||
|
allowedExtensions: ["json"],
|
||||||
|
fileName: name,
|
||||||
|
bytes: utf8.encode(jsonEncode(
|
||||||
|
prefs!.getStringList("chats") ?? [])));
|
||||||
|
}
|
||||||
selectionHaptic();
|
selectionHaptic();
|
||||||
if (path == null) return;
|
if (path == null) return;
|
||||||
if (desktopFeature()) {
|
if (desktopFeature()) {
|
||||||
|
|
@ -103,30 +115,54 @@ class _ScreenSettingsExportState extends State<ScreenSettingsExport> {
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
selectionHaptic();
|
selectionHaptic();
|
||||||
FilePickerResult? result =
|
|
||||||
await FilePicker.platform
|
|
||||||
.pickFiles(
|
|
||||||
type: FileType.custom,
|
|
||||||
allowedExtensions: [
|
|
||||||
"json"
|
|
||||||
]);
|
|
||||||
if (result == null) {
|
|
||||||
// ignore: use_build_context_synchronously
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
String content;
|
String content;
|
||||||
try {
|
try {
|
||||||
File file = File(
|
if (kIsWeb) {
|
||||||
result.files.single.path!);
|
throw Exception(
|
||||||
|
"web must use file picker");
|
||||||
|
}
|
||||||
|
file_selector.XFile? result =
|
||||||
|
await file_selector.openFile(
|
||||||
|
acceptedTypeGroups: [
|
||||||
|
const file_selector
|
||||||
|
.XTypeGroup(
|
||||||
|
label:
|
||||||
|
"Ollama App File",
|
||||||
|
extensions: ["json"])
|
||||||
|
]);
|
||||||
|
if (result == null) {
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
content =
|
content =
|
||||||
await file.readAsString();
|
await result.readAsString();
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
content = utf8.decode(result
|
FilePickerResult? result =
|
||||||
.files
|
await FilePicker.platform
|
||||||
.single
|
.pickFiles(
|
||||||
.bytes as List<int>);
|
type:
|
||||||
|
FileType.custom,
|
||||||
|
allowedExtensions: [
|
||||||
|
"json"
|
||||||
|
]);
|
||||||
|
if (result == null) {
|
||||||
|
// ignore: use_build_context_synchronously
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
File file = File(result
|
||||||
|
.files.single.path!);
|
||||||
|
content =
|
||||||
|
await file.readAsString();
|
||||||
|
} catch (_) {
|
||||||
|
// web fallback
|
||||||
|
content = utf8.decode(result
|
||||||
|
.files
|
||||||
|
.single
|
||||||
|
.bytes as List<int>);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
List<dynamic> tmpHistory =
|
List<dynamic> tmpHistory =
|
||||||
jsonDecode(content);
|
jsonDecode(content);
|
||||||
|
|
|
||||||
32
pubspec.lock
32
pubspec.lock
|
|
@ -225,6 +225,30 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.2"
|
version: "8.1.2"
|
||||||
|
file_selector:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: file_selector
|
||||||
|
sha256: "5019692b593455127794d5718304ff1ae15447dea286cdda9f0db2a796a1b828"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.3"
|
||||||
|
file_selector_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_android
|
||||||
|
sha256: "77f23eb5916fd0875946720d1f286f809a28a867d4882db6ac2cf053e2d5f7c6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.1+6"
|
||||||
|
file_selector_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_ios
|
||||||
|
sha256: "38ebf91ecbcfa89a9639a0854ccaed8ab370c75678938eebca7d34184296f0bb"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.3"
|
||||||
file_selector_linux:
|
file_selector_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -249,6 +273,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.2"
|
version: "2.6.2"
|
||||||
|
file_selector_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_web
|
||||||
|
sha256: c4c0ea4224d97a60a7067eca0c8fd419e708ff830e0c83b11a48faf566cec3e7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.9.4+2"
|
||||||
file_selector_windows:
|
file_selector_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ dependencies:
|
||||||
restart_app: ^1.2.1
|
restart_app: ^1.2.1
|
||||||
flutter_markdown: ^0.7.1
|
flutter_markdown: ^0.7.1
|
||||||
file_picker: ^8.0.3
|
file_picker: ^8.0.3
|
||||||
|
file_selector: ^1.0.3
|
||||||
bitsdojo_window: ^0.1.6
|
bitsdojo_window: ^0.1.6
|
||||||
install_referrer: ^1.2.1
|
install_referrer: ^1.2.1
|
||||||
package_info_plus: ^8.0.0
|
package_info_plus: ^8.0.0
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
; Script generated by the Inno Setup Script Wizard.
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
; #define AppVersion "1.0.1"
|
;#define AppVersion "1.0.1"
|
||||||
|
|
||||||
#define AppName "Ollama App"
|
#define AppName "Ollama App"
|
||||||
#define AppPublisher "JHubi1"
|
#define AppPublisher "JHubi1"
|
||||||
|
|
@ -27,7 +27,7 @@ UninstallDisplayName={#AppName}
|
||||||
|
|
||||||
DefaultDirName={autopf}\OllamaApp
|
DefaultDirName={autopf}\OllamaApp
|
||||||
OutputDir=build\windows\{#AppArchitectures}\runner
|
OutputDir=build\windows\{#AppArchitectures}\runner
|
||||||
OutputBaseFilename=ollama-v{#AppVersion}-{#AppArchitectures}
|
OutputBaseFilename=ollama-windows-{#AppArchitectures}-v{#AppVersion}
|
||||||
|
|
||||||
AppSupportURL=https://github.com/JHubi1/ollama-app/issues
|
AppSupportURL=https://github.com/JHubi1/ollama-app/issues
|
||||||
AppUpdatesURL=https://github.com/JHubi1/ollama-app/releases
|
AppUpdatesURL=https://github.com/JHubi1/ollama-app/releases
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ UninstallDisplayName={#AppName}
|
||||||
|
|
||||||
DefaultDirName={autopf}\OllamaApp
|
DefaultDirName={autopf}\OllamaApp
|
||||||
OutputDir=build\windows\{#AppArchitectures}\runner
|
OutputDir=build\windows\{#AppArchitectures}\runner
|
||||||
OutputBaseFilename=ollama-v{#AppVersion}-{#AppArchitectures}
|
OutputBaseFilename=ollama-windows-{#AppArchitectures}-v{#AppVersion}
|
||||||
|
|
||||||
AppSupportURL=https://github.com/JHubi1/ollama-app/issues
|
AppSupportURL=https://github.com/JHubi1/ollama-app/issues
|
||||||
AppUpdatesURL=https://github.com/JHubi1/ollama-app/releases
|
AppUpdatesURL=https://github.com/JHubi1/ollama-app/releases
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue