diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 372959b9..651d6ee6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,25 +3,20 @@ run-name: Build Linux on: workflow_dispatch: {} jobs: - Build_IOS: + Build_Deb: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - architecture: x64 - - run: | - sudo apt-get update -y - sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1 - - run: flutter pub get - - run: flutter build linux - - name: build AppImage - uses: AppImageCrafters/build-appimage-action@master - env: - UPDATE_INFO: no - with: - recipe: AppImageBuilder.yml - - uses: actions/upload-artifact@v4 - with: - name: AppImage \ No newline at end of file + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + 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 + - uses: actions/upload-artifact@v4 + with: + name: deb_build + path: build/linux/x64/release/debian \ No newline at end of file diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml deleted file mode 100644 index cd533ea5..00000000 --- a/AppImageBuilder.yml +++ /dev/null @@ -1,61 +0,0 @@ -# appimage-builder recipe see https://appimage-builder.readthedocs.io for details -version: 1 -script: - - rm -rf AppDir || true - - cp -r build/linux/x64/release/bundle AppDir - - mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/ - - mv AppDir/lib/ AppDir/usr/ - - cp linux/icon.png AppDir/usr/share/icons/hicolor/64x64/apps/ -AppDir: - path: ./AppDir - app_info: - id: com.github.wgh136.PicaComic - name: PicaComic - icon: icon - version: 4.0.2 - exec: pica_comic - exec_args: $@ - apt: - arch: amd64 - allow_unauthenticated: true - sources: - - sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse - - sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse - - sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse - - sourceline: deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse - include: - - libgtk-3-0 - - libwebkit2gtk-4.1-0 - exclude: - - humanity-icon-theme - - hicolor-icon-theme - - adwaita-icon-theme - - ubuntu-mono - files: - include: - - /lib64/ld-linux-x86-64.so.2 - exclude: - - usr/share/man - - usr/share/doc/*/README.* - - usr/share/doc/*/changelog.* - - usr/share/doc/*/NEWS.* - - usr/share/doc/*/TODO.* - test: - fedora-30: - image: appimagecrafters/tests-env:fedora-30 - command: ./AppRun - debian-stable: - image: appimagecrafters/tests-env:debian-stable - command: ./AppRun - archlinux-latest: - image: appimagecrafters/tests-env:archlinux-latest - command: ./AppRun - centos-7: - image: appimagecrafters/tests-env:centos-7 - command: ./AppRun - ubuntu-xenial: - image: appimagecrafters/tests-env:ubuntu-xenial - command: ./AppRun -AppImage: - arch: x86_64 - update-information: guess diff --git a/debian/build.py b/debian/build.py new file mode 100644 index 00000000..cbd5b0c5 --- /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/pica.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) diff --git a/debian/debian.yaml b/debian/debian.yaml new file mode 100644 index 00000000..f03d9c56 --- /dev/null +++ b/debian/debian.yaml @@ -0,0 +1,18 @@ +flutter_app: + command: pica_comic + arch: x64 + parent: /usr/local/lib + nonInteractive: true + execFieldCodes: u + +control: + Package: pica-comic + Version: {{Version}} + Architecture: amd64 + Priority: optional + Depends: + Maintainer: nyne + Description: pica comic + +#options: +# exec_out_dir: debian/packages \ No newline at end of file diff --git a/debian/gui/pica-comic.desktop b/debian/gui/pica-comic.desktop new file mode 100644 index 00000000..05e20251 --- /dev/null +++ b/debian/gui/pica-comic.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version={{Version}} +Name=PicaComic +GenericName=PicaComic +Comment=pica comic +Terminal=false +Type=Application +Categories=Utility +Keywords=Flutter;comic;images; \ No newline at end of file diff --git a/linux/icon.png b/debian/gui/pica-comic.png similarity index 100% rename from linux/icon.png rename to debian/gui/pica-comic.png