Auto build on build.snapcraft.io questions

We are having a hard time trying to use build. snapcraft. io to publish our software to snap store. We couldn’t find any documents for build.snapcraft.io service itself, so here are my questions.

  1. How to select default branch for auto build? It seems that build. snapcraft. io will automatically build for every commit pushed to default branch. We are using a branch name “release” and creating tags from it. How to change build.snapcraft.io to use this branch?

  2. Is it possible to automatically build for multiple branches and release to multiple channels? What we want are:

  • build latest commit of “develop” branch and release to edge channel
  • build tags with beta/rc and release to beta/candidate channels
  • build tags with non beta/rc in name and release to stable channel

PS: sorry for formatting, for some reasons I’m now allowed to write more than 2 links in a post.

you define “source-branch:” in your snapcraft.yaml …

not with build.snapcraft.io, if you build directly on launchpad (by mirroring the repo and setting up an automatic import) instead (both use the same build backend), this might be possible.

for a rough overview see the bottom of https://github.com/snapcore/pi3-gadget

and for detailed setup instructions:

https://kyrofa.com/posts/building-your-snap-on-device-there-s-a-better-way

1 Like

you define “source-branch:” in your snapcraft.yaml …

Thanks @ogra, I linked the document page here for future reference: https://docs.snapcraft.io/build-snaps/syntax#source-branch.