Recommended Github Actions to build and publish snaps

Hello and sorry if this has been answered clearly before.

I have a fairly simple snap that builds a rust project and are planning to automate the process of building and publishing the snap with Github Actions.

Are there any recommended actions to import for these purposes?

I found this https://github.com/marketplace/actions/snapcraft-action and it seems like what I want but I thought I could also ask the question to see if there is anything else out there.

I was having a similar situation last week and ended up getting the feeling that https://github.com/snapcore/action-build + https://github.com/snapcore/action-publish would likely be the more official actions, at least based on the regular contributors of those repositories.

However, there’s also the catch that using those actions will get you only the amd64 architecture build. For other architecture, the current options appeared to be either triggering build + publish via Launchpad (which I ended up using) or possibly actions/snapcraft-multiarch-build (which I didn’t test).

I went with using https://github.com/snapcore/action-build which works in my case.

I’m also trying out building by linking the Github repo in the build tab of the admin interface of the snap. Is this what you meant with Launchpad? It looked like it ran on Launchpad instance in the logs.

I’m not sure what I will use in the end.

I initially tried the GitHub repo linking in the “Builds” tab and while that resulted in builds succeeding, those didn’t become visible on the “Releases” tab + I didn’t find any API for triggering those remotely so it felt a little bit limited in what it can do in addition to not really working.

For Launchpad integration, I followed this older but still accurate enough video: https://www.youtube.com/watch?v=X_U-pcvBFrU

The main difference is that I’ve setup the GitHub actions to force push the GitHub repo content to Launchpad when all the defined criterias are met which then results in the build + publish actions triggering in Launchpad. See the workflows in https://github.com/vergoh/vnstat-snap if you need an example on how that was done.

1 Like