Travis CI can automatically upload and release your app to the Snap Store after a successful build.
Snapcraft lets you distribute to all Ubuntu releases and a growing set of Linux distributions with a single artefact. You publish and update at your pace while still reaching everyone; you’re not locked to the release cycle of Ubuntu or any other distribution. The updates apply automatically and roll back if anything goes wrong. They’re secure; each update is cryptographically signed and is tamper-proof once installed. The applications are locked down using the same container primitives found in Docker and LXD.
To upload your snap, add the following to your
dist: xenial deploy: provider: snap snap: my_*.snap channel: edge skip_cleanup: true
snap value should be a string that matches exactly one file when the deployment starts.
If the name of the snap file is not known ahead of time, you can use a shell glob pattern, as shown
in the example above.
Providing credentials to upload the snap #
To upload snaps from Travis CI, export a Snap Store login token, and provide it as an environment variable
If you have not done so already, enable snap support on your system.
sudo snap install snapcraft --classic
Login tokens can specify how, when, and where they can be used, thus minimising damage from compromise.
For Travis CI, export a token that can only upload this snap to the channel you specified above (in this example,
snapcraft export-login --snaps my-snap-name --channels edge -
Note: The final
- requests the login be exported to stdout instead of a file. It is required.
The token will be printed out.
edge channel is intended for the bleeding edge: your every commit to master will be built and uploaded.
Using the CLI client #
Using our CLI client, define
# in the repository root travis env set SNAP_TOKEN "<token>"
Using Settings page #
Equivalently, you can do this on the Settings page of your repository at Travis CI.
Using uploaded Snap #
Your community of early-adopters and testers can install your app in any of the supported Linux distributions with:
sudo snap install my-snap-name --edge
Each upload gets a monotonically increasing integer. When you’re ready, you can release one of these built commits to the stable channel for public discovery in the Snap storefront. For example, you could promote the very first upload to stable:
snapcraft release my-snap-name 1 stable