Submit Copr builds by GitHub “push” actions
Since my last on-topic post (mostly about GitHub’s third-party CI provider Travis CI), another alternative for submitting RPM builds in Copr appeared on GitHub – GitHub Actions.
Let’s admit this fact now: From our perspective, GitHub Actions do not bring anything new into the game. Namely, we have Turing-complete language (good) and we still can not store private tokens (needed e.g. for Copr API token) that could be used securely at the pull-request time - that’s bad, especially for Open Source projects.
But, yes, at least we don’t have to use a third-party application for computational power, and the format of defining Actions (or “workflows”) is (at least subjectively) simpler than before.
Setup the CI for GitHub push events
First, go to the GitHub project you maintain, and:
- Go to the Settings menu.
- Go to the Actions sub-menu.
- Toggle the Enable local and third party Actions for this repository radio
button option. This is needed to successfully run external
actions/checkout@v1
action. - Go to Secrets menu, and provide a New Secret named
COPR_API_TOKEN
, filled by contents of the Copr API page (login required).
Then go to the local clone of your project, and push an arbitrarily named
*.yml
file into .github/workflows/
directory; with content similar to this
one:
This is a simple example (or template) that needs some custom tweaks, namely packages and commands needed to build source RPM. But it is indeed enough in practice.
Having Actions as a 1:1 alternative for Travis CI, feel free to read the old post. You can implement the very same work-flow using Github Actions (perhaps for pull-requests, too).
Edit by 2021-11-26: Travis CI is starting to be very painful to use for FLOSS projects, therefore the argparse-manpage pull-request CI was eventually moved from Travis CI to GitHub Actions.
But this post provided a lot simpler, a “starter”, Actions example.
Happy building!