resources icon indicating copy to clipboard operation
resources copied to clipboard

Add GitHub Actions Workflow

Open rgl opened this issue 2 years ago • 4 comments

Does it make sense to add a GitHub Actions Workflow? It could:

  • build and test this repository code after each git push
  • automatically publish the package to Flathub after a git tag is pushed

rgl avatar Oct 15 '23 15:10 rgl

Hi! It certainly would make sense! Though if I'm being honest, I've never really worked with GitHub Actions, so I'd have to do some research on that. 😅

nokyan avatar Oct 15 '23 16:10 nokyan

I can help with that!

How are you currently publishing to Flathub (I never did this before)? It seems there's https://github.com/flathub/net.nokyan.Resources and an associated CI at https://buildbot.flathub.org/#/builders/19/builds/9067. Can you explain how does that work?

rgl avatar Oct 15 '23 17:10 rgl

Thank you for offering your help!

My current workflow looks like this:

  • Publish a new release on this repo with a git tag such as v1.1.0
  • Use the flatpak-cargo-generator to generate generated-sources.json, which contains all the Rust dependencies. That way they are downloaded by the Buildbot itself before cargo tries to do so because the Buildbot does not allow arbitrary access to the internet while building
  • Change the Flatpak manifest to update the commit and tag properties for the new update in a new branch in the Flathub repo
  • (Test the build locally to see if everything properly deployed and installed as a Flatpak works)
  • Open a pull request such as https://github.com/flathub/net.nokyan.Resources/pull/2
  • This pull request will cause the Flathub Buildbot to automatically build against the updated Flatpak manifest. If this build succeeds, the pull request may be merged
  • Once the pull request is merged, the Buildbot will build it again (most likely it's not a complete rebuild since the last commit to the pull request before merge has to lead to a successful build) and publish that build to Flathub after 3 hours if I don't publish it manually earlier.

There is also this related to Flathub and GitHub Action: https://github.com/flatpak/flatpak-github-actions At the moment it's quite manual, but as I hope not to have to make new releases too often, I'm fine with what it is at the moment, so there's no need to rush :)

nokyan avatar Oct 16 '23 14:10 nokyan

Thank You for the details! I think I have everything needed to start cracking all those steps, one at a time :-)

BTW, I'm using this as a learning exercise about Rust, Flatpak, and Flatpak distribution/publication.

rgl avatar Oct 16 '23 18:10 rgl