From 1bea29ddf4dc5e70a237e1717a46b7a11941a9b1 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 14 May 2023 17:17:12 +0200 Subject: [PATCH] Add snapcraft config (#11) --- .github/workflows/ci.yaml | 12 ++++++++++++ assets/calculator.desktop | 9 +++++++++ pubspec.yaml | 3 +++ snap/snapcraft.yaml | 24 ++++++++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 assets/calculator.desktop create mode 100644 snap/snapcraft.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 019babb..635e34e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,6 +69,18 @@ jobs: - run: flutter pub get - run: flutter build macos -v + snap: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: snapcore/action-build@v1 + id: snapcraft + - uses: actions/upload-artifact@v3 + if: github.event_name == 'workflow_dispatch' + with: + name: 'snap' + path: ${{steps.snapcraft.outputs.snap}} + test: runs-on: ubuntu-22.04 steps: diff --git a/assets/calculator.desktop b/assets/calculator.desktop new file mode 100644 index 0000000..49e26e7 --- /dev/null +++ b/assets/calculator.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Calculator +Comment=Calculator example +Keywords=flutter;yaru;example; +Exec=calculator +Terminal=false +Categories=Example; diff --git a/pubspec.yaml b/pubspec.yaml index 1b45d75..92c2f9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,5 @@ name: calculator +description: Calculator example publish_to: 'none' environment: @@ -28,3 +29,5 @@ dev_dependencies: flutter: generate: true uses-material-design: true + assets: + - assets/ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..ed3bd8f --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,24 @@ +name: calculator +version: git +summary: Calculator +description: Calculator example +confinement: strict +base: core22 +grade: stable +license: GPL-3.0+ +architectures: + - build-on: amd64 + build-for: amd64 + - build-on: arm64 + build-for: arm64 + +parts: + calculator: + plugin: flutter + source: . + +apps: + calculator: + command: calculator + desktop: data/flutter_assets/assets/calculator.desktop + extensions: [gnome]