Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
debian package build script
Browse files Browse the repository at this point in the history
  • Loading branch information
wgh136 committed Aug 28, 2024
1 parent e526909 commit 2b26465
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 81 deletions.
35 changes: 15 additions & 20 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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
61 changes: 0 additions & 61 deletions AppImageBuilder.yml

This file was deleted.

26 changes: 26 additions & 0 deletions debian/build.py
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 18 additions & 0 deletions debian/debian.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions debian/gui/pica-comic.desktop
Original file line number Diff line number Diff line change
@@ -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;
File renamed without changes

0 comments on commit 2b26465

Please sign in to comment.