32.10 Flutter App Bundle for Linux Snap
20251004
Snapcraft is a tool and framework for building and publishing snap packages on Linux. Developers package their applications as snaps, which are self-contained software packages that include all dependencies. Snapcraft handles the building, packaging, and publishing process for snap applications.
To build a snap package we create a snapcraft.yaml
file that defines
how to build the application, the dependencies required, and how to
run the app. The package typically also contains gui/icon.png
and
gui/appname.desktop
The Snap Store hosts published snaps from
where users can easily install the app using the snap
command:
To test the package locally you can run:
As a registerd developer you can publish apps to the store. All registered developers are vetted by Canonical. To register an app:
And then to publish an app to the stable channel:
The notepod
app is then listed at the snap store
SnapCraft.
Github actions are available to support the build of the snap package.
package-linux-snap:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Build snap
if: hashFiles('snap/**') != ''
uses: snapcore/action-build@v1
id: build
- name: Upload snap artifact
if: hashFiles('snap/**') != ''
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP }}-linux-snap
path: ${{ steps.build.outputs.snap }}
Resources
Examples
- NotePod: An example
snapcraft.yaml
andgui
files and github workflow
https://github.com/anusii/notepod/tree/dev/snap - https://github.com/ubuntu-flutter-community/musicpod/blob/v2.1.0/.github/workflows/release.yml+ https://github.com/AppFlowy-IO/AppFlowy/tree/main/frontend/scripts
- Pulse: An example
snap.yam
and a github workflow
https://github.com/ubuntu-flutter-community/pulse - https://github.com/ubuntu-flutter-community/nebuchadnezzar/tree/main/snap
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0
