update version code; add linux build script

This commit is contained in:
nyne
2024-06-12 21:51:20 +08:00
parent 4476ad7f90
commit 6118fc30f8
5 changed files with 31 additions and 4 deletions

27
debian/build.py vendored Normal file
View File

@@ -0,0 +1,27 @@
import subprocess
import os
debianContent = ''
desktopContent = ''
version = ''
with open('debian/debian.yaml', 'r') as f:
debianContent = f.read()
with open('debian/gui/pixes.desktop', 'r') as f:
desktopContent = f.read()
with open('pubspec.yaml', 'r') as f:
version = str.split(str.split(f.read(), 'version: ')[1], '+')[0]
with open('debian/debian.yaml', 'w') as f:
f.write(debianContent.replace('{{Version}}', version))
with open('debian/gui/pixes.desktop', 'w') as f:
f.write(desktopContent.replace('{{Version}}', version))
subprocess.run(["flutter", "build", "linux"])
subprocess.run(["$HOME/.pub-cache/bin/flutter_to_debian"], shell=True)
with open('debian/debian.yaml', 'w') as f:
f.write(debianContent)
with open('debian/gui/pixes.desktop', 'w') as f:
f.write(desktopContent)

2
debian/debian.yaml vendored
View File

@@ -7,7 +7,7 @@ flutter_app:
control: control:
Package: pixes Package: pixes
Version: 1.0.6 Version: {{Version}}
Architecture: amd64 Architecture: amd64
Priority: optional Priority: optional
Depends: Depends:

View File

@@ -1,5 +1,5 @@
[Desktop Entry] [Desktop Entry]
Version=1.0.6 Version={{Version}}
Name=Pixes Name=Pixes
GenericName=Pixes GenericName=Pixes
Comment=Unofficial pixiv application Comment=Unofficial pixiv application

View File

@@ -12,7 +12,7 @@ export "state_controller.dart";
export "navigation.dart"; export "navigation.dart";
class _App { class _App {
final version = "1.0.6"; final version = "1.0.7";
bool get isAndroid => Platform.isAndroid; bool get isAndroid => Platform.isAndroid;
bool get isIOS => Platform.isIOS; bool get isIOS => Platform.isIOS;

View File

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.6+106 version: 1.0.7+107
environment: environment:
sdk: '>=3.3.4 <4.0.0' sdk: '>=3.3.4 <4.0.0'