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:

snap install notepod

To test the package locally you can run:

snap install --dangerous notepod.snap

As a registerd developer you can publish apps to the store. All registered developers are vetted by Canonical. To register an app:

snapcraft register notepod

And then to publish an app to the stable channel:

snapcraft upload --release=stable installers/ARCHIVE/notepod_0.2.38_amd64.snap

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



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