diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml new file mode 100644 index 0000000..29c2840 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -0,0 +1,48 @@ +name: Report a bug +description: Reporting problems with the APP +title: "[Bug]: " +labels: ["bug🐞"] +body: + - type: markdown + attributes: + value: | + Thank you for reporting a problem, please complete the title and fill in the following information. + - type: textarea + id: what-happened + attributes: + label: Description + description: Describe the problem + validations: + required: true + - type: input + id: version + attributes: + label: Version + description: | + App version + Please try to update if it is not the latest version + validations: + required: true + - type: dropdown + id: platform + attributes: + label: Operating system + multiple: true + options: + - Android + - iOS + - Windows + - macOS + - linux + - other + validations: + required: true + - type: textarea + id: logs + attributes: + label: logs + - type: textarea + id: screenshotOrVideo + attributes: + label: Screenshot or video + description: Upload relevant screenshots or videos here \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml new file mode 100644 index 0000000..0162f71 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.yaml @@ -0,0 +1,36 @@ +name: Feature Request +description: Suggest improvements to the APP +title: "[Enhancement]: " +labels: ["enhancement🚀"] +body: + - type: markdown + attributes: + value: | + Welcome to make a feature request, please fill in the following information after completing the title. + - type: textarea + id: what-happened + attributes: + label: Description + description: Describe your suggestion. + validations: + required: true + - type: dropdown + id: platform + attributes: + label: Operating System + description: If the feature is for a particular platform, please select here + multiple: true + options: + - Android + - iOS + - Windows + - macOS + - linux + - other + validations: + required: false + - type: textarea + id: screenshotOrVideo + attributes: + label: picture + description: If you need to use a picture, please upload it here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml new file mode 100644 index 0000000..145744e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -0,0 +1,9 @@ +name: other +description: Other contents +body: + - type: textarea + id: what-happened + attributes: + label: Content + validations: + required: true diff --git a/.github/workflows/delete_old_workflows.yml b/.github/workflows/delete_old_workflows.yml new file mode 100644 index 0000000..af16fda --- /dev/null +++ b/.github/workflows/delete_old_workflows.yml @@ -0,0 +1,66 @@ +name: Delete old workflow runs +on: + workflow_dispatch: + inputs: + days: + description: 'Days-worth of runs to keep for each workflow' + required: true + default: '30' + minimum_runs: + description: 'Minimum runs to keep for each workflow' + required: true + default: '6' + delete_workflow_pattern: + description: 'Name or filename of the workflow (if not set, all workflows are targeted)' + required: false + delete_workflow_by_state_pattern: + description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' + required: true + default: "ALL" + type: choice + options: + - "ALL" + - active + - deleted + - disabled_inactivity + - disabled_manually + delete_run_by_conclusion_pattern: + description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success' + required: true + default: "ALL" + type: choice + options: + - "ALL" + - "Unsuccessful: action_required,cancelled,failure,skipped" + - action_required + - cancelled + - failure + - skipped + - success + dry_run: + description: 'Logs simulated changes, no deletions are performed' + required: false + +jobs: + del_runs: + runs-on: ubuntu-latest + permissions: + actions: write + contents: read + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: ${{ github.event.inputs.days }} + keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} + delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} + delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} + delete_run_by_conclusion_pattern: >- + ${{ + startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:') + && 'action_required,cancelled,failure,skipped' + || github.event.inputs.delete_run_by_conclusion_pattern + }} + dry_run: ${{ github.event.inputs.dry_run }} \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..558ea6f --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,33 @@ +name: Build Linux +run-name: Build Linux +on: + workflow_dispatch: {} +jobs: + Build_Linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version-file: pubspec.yaml + architecture: x64 + - run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1 + dart pub global activate flutter_to_debian + - run: python3 debian/build.py + - run: dart run flutter_to_arch + - run: | + sudo rm -rf build/linux/arch/app.tar.gz + sudo rm -rf build/linux/arch/pkg + sudo rm -rf build/linux/arch/src + sudo rm -rf build/linux/arch/PKGBUILD + - uses: actions/upload-artifact@v4 + with: + name: deb_build + path: build/linux/x64/release/debian + - uses: actions/upload-artifact@v4 + with: + name: arch_build + path: build/linux/arch/ \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d1a82c9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,43 @@ +name: Build IOS +run-name: Build IOS +on: + workflow_dispatch: {} +jobs: + Build_IOS: + runs-on: macos-13 + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version-file: pubspec.yaml + architecture: x64 + - run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app + - run: flutter pub get + - run: flutter build ios --release --no-codesign + - run: | + mkdir -p /Users/runner/work/venera/venera/build/ios/iphoneos/Payload + mv /Users/runner/work/venera/venera/build/ios/iphoneos/Runner.app /Users/runner/work/venera/venera/build/ios/iphoneos/Payload + cd /Users/runner/work/venera/venera/build/ios/iphoneos/ + zip -r venera-ios.ipa Payload + - uses: actions/upload-artifact@v4 + with: + name: app-ios.ipa + path: /Users/runner/work/venera/venera/build/ios/iphoneos/venera-ios.ipa + Build_MacOS: + runs-on: macos-13 + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version-file: pubspec.yaml + architecture: x64 + - run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app + - run: flutter pub get + - run: flutter build macos --release + - uses: actions/upload-artifact@v4 + with: + name: macos-build.zip + path: build/macos/Build/Products/Release/venera.app + \ No newline at end of file diff --git a/debian/build.py b/debian/build.py new file mode 100644 index 0000000..0547d45 --- /dev/null +++ b/debian/build.py @@ -0,0 +1,26 @@ +import subprocess + +debianContent = '' +desktopContent = '' +version = '' + +with open('debian/debian.yaml', 'r') as f: + debianContent = f.read() +with open('debian/gui/venera.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/venera.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/venera.desktop', 'w') as f: + f.write(desktopContent) diff --git a/debian/debian.yaml b/debian/debian.yaml new file mode 100644 index 0000000..545a025 --- /dev/null +++ b/debian/debian.yaml @@ -0,0 +1,17 @@ +flutter_app: + command: venera + arch: x64 + parent: /usr/local/lib + nonInteractive: false + +control: + Package: venera + Version: {{Version}} + Architecture: amd64 + Priority: optional + Depends: libwebkit2gtk-4.1-0, libgtk-3-0 + Maintainer: nyne + Description: venera + +#options: +# exec_out_dir: debian/packages \ No newline at end of file diff --git a/debian/gui/venera.desktop b/debian/gui/venera.desktop new file mode 100644 index 0000000..39d1650 --- /dev/null +++ b/debian/gui/venera.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version={{Version}} +Name=Venera +GenericName=Venera +Comment=venera +Terminal=false +Type=Application +Categories=Utility +Keywords=Flutter;comic;images; \ No newline at end of file diff --git a/debian/gui/venera.png b/debian/gui/venera.png new file mode 100644 index 0000000..ffd7fef Binary files /dev/null and b/debian/gui/venera.png differ diff --git a/pubspec.lock b/pubspec.lock index d9f7e92..e34d6e4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -33,6 +33,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" async: dependency: transitive description: @@ -282,6 +290,23 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_to_arch: + dependency: "direct dev" + description: + path: "." + ref: HEAD + resolved-ref: "15bfead0380fda79b0256b37c73b886b0882f1bf" + url: "https://github.com/wgh136/flutter_to_arch" + source: git + version: "1.0.0" + flutter_to_debian: + dependency: "direct dev" + description: + name: flutter_to_debian + sha256: d23534407334b331ce20fbaa8395b9ecc255d0c047136b8998715f36933ee696 + url: "https://pub.dev" + source: hosted + version: "2.0.2" flutter_web_plugins: dependency: transitive description: flutter @@ -319,6 +344,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.19.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" js: dependency: transitive description: @@ -391,6 +424,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + mime_type: + dependency: transitive + description: + name: mime_type + sha256: d652b613e84dac1af28030a9fba82c0999be05b98163f9e18a0849c6e63838bb + url: "https://pub.dev" + source: hosted + version: "1.0.1" path: dependency: "direct main" description: @@ -736,4 +777,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.3" + flutter: ">=3.24.4" diff --git a/pubspec.yaml b/pubspec.yaml index 282be16..5da5dfa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ version: 1.0.0+1 environment: sdk: '>=3.5.0 <4.0.0' - flutter: 3.24.3 + flutter: 3.24.4 dependencies: flutter: @@ -55,6 +55,9 @@ dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^3.0.0 + flutter_to_arch: + git: https://github.com/wgh136/flutter_to_arch + flutter_to_debian: flutter: uses-material-design: true @@ -65,3 +68,12 @@ flutter: - assets/tags.json - assets/tags_tw.json +flutter_to_arch: + name: Venera + icon: debian/gui/venera.png + categories: Utility + keywords: Flutter;comic;images; + url: https://github.com/venera-app/venera + depends: + - gtk3 + - webkit2gtk-4.1 \ No newline at end of file diff --git a/windows/build.iss b/windows/build.iss new file mode 100644 index 0000000..13857e5 --- /dev/null +++ b/windows/build.iss @@ -0,0 +1,63 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Venera" +#define MyAppVersion "{{version}}" +#define MyAppPublisher "wgh136" +#define MyAppURL "https://github.com/venera-app/venera" +#define MyAppExeName "venera.exe" +#define RootPath "{{root_path}}" + +[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={{B2DED6B2-9A2D-40C3-B008-9B518A628BCA} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir={#RootPath}\build\windows +OutputBaseFilename=Venera-{#MyAppVersion}-windows-installer +SetupIconFile={#RootPath}\windows\runner\resources\app_icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "{#RootPath}\build\windows\x64\runner\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\flutter_inappwebview_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\app_links_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\sqlite3.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\sqlite3_flutter_libs_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\flutter_windows.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\flutter_qjs_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\desktop_webview_window_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\WebView2Loader.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\share_plus_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\url_launcher_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\screen_retriever_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\window_manager_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#RootPath}\build\windows\x64\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs +; 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 \ No newline at end of file diff --git a/windows/build.py b/windows/build.py new file mode 100644 index 0000000..6ad1d85 --- /dev/null +++ b/windows/build.py @@ -0,0 +1,32 @@ +import subprocess +import os + +file = open('pubspec.yaml', 'r') +content = file.read() +file.close() + +subprocess.run(["flutter", "build", "windows"], shell=True) + +if os.path.exists("build/app-windows.zip"): + os.remove("build/app-windows.zip") + +version = str.split(str.split(content, 'version: ')[1], '+')[0] + +subprocess.run(["tar", "-a", "-c", "-f", f"build/windows/Venera-{version}-windows.zip", "-C", "build/windows/x64/runner/Release", "."] + , shell=True) + +issContent = "" +file = open('windows/build.iss', 'r') +issContent = file.read() +newContent = issContent +newContent = newContent.replace("{{version}}", version) +newContent = newContent.replace("{{root_path}}", os.getcwd()) +file.close() +file = open('windows/build.iss', 'w') +file.write(newContent) +file.close() + +subprocess.run(["iscc", "windows/build.iss"], shell=True) + +with open('windows/build.iss', 'w') as file: + file.write(issContent) \ No newline at end of file