Automate snapcraft remote-build on github actions

Hello,

I’m trying to automate the “snapcraft remote-build” step on github actions, but as it always runs on a different host, it always asks for the launchpad oauth authorization token and hangs on that, even though I’m logged in to snapcraft.io using “snapcraft login”.

Is there a way to either allow all hosts to build on my account or to provide a specific token for it when building?

FWIW, we tried using snapcraft.io build, but its not that flexible for us. We wanted to run some automated deployment tests on the packages after building but it didn’t seem like there was a way to do that (nor a way to make it call a webhook to do that externally), it just built them and released on the edge channel at each commit to the repo (we only really wanted that on created releases also).

At the moment, remote-build is not designed to be used in CI and I wouldn’t recommend it. There are certainly some improvements that would need to be made for it to be a good & reliable experience.

At a minimum, you’d need to:
(1) use a secret to populate ~/.local/share/snapcraft/provider/launchpad/credentials in the environment, from the host where you logged in. Caveat that this may change someday.
(2) prevent parallel builds with something like https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency