jj icon indicating copy to clipboard operation
jj copied to clipboard

packaging: automated COPR builds on release

Open AldanTanneo opened this issue 1 month ago • 4 comments

Fixes #6469

This is a possible way of setting up COPR builds for jj, but it would need setting up an official jj account on https://copr.fedorainfracloud.org first.

On each release this would write the version (from the tag name) to the copr.spec file and schedule the build on COPR from it. It does not create packages for every dependency, instead it does an online build. No sources are bundled, the SRPM is created from the release tarball by the COPR infrastructure. This is how I set up my own COPR (https://github.com/AldanTanneo/copr-jj), but the Github action there has to check for new releases every day, whereas this action can just react to new releases.

Needed for working builds:

  • [ ] a COPR account named jj-vcs (tbd)
  • [ ] a project in this account named jj (tbd)
  • [ ] credentials for this account added to Github actions secrets: COPR_LOGIN, COPR_TOKEN.

Checklist

If applicable:

  • [x] I have updated CHANGELOG.md
  • [x] I have updated the documentation (README.md, docs/, demos/)
  • [x] I have updated the config schema (cli/src/config-schema.json)
  • [x] I have added/updated tests to cover my changes

AldanTanneo avatar Oct 20 '25 10:10 AldanTanneo

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Oct 20 '25 10:10 google-cla[bot]

It would be nice to have a jj package for fedora! Note that I don't know how the maintainers feel about adding credentials in the github project.

For COPR there are several options available, including adding a webhook to automatically schedule builds on new tags. It would not require credentials in GitHub secrets, and would happen outside of Github actions.

On which OS would we be able to use that repository?

That depends on how the people in charge set up the COPR repo! On my personal COPR, I set it up for fedora 42/43/rawhide (x86_64 and aarch64), with automatic branching to follow fedora releases as they go. But there are a lot more options available, including RHEL, CentOS, openSUSE, ... and several other architectures.

How can we make sure the release won't fail because there is a misconfiguration in the spec file or in the copr access? Maybe it would be possible to submit builds in the CI?

I chose to put the --nowait flag to not consume actions minutes, but it could be removed to assert that the build succedeed. For CI, I'm not sure, it's a tricky issue (scheduling a new build on every PR doesn't sound very reasonable to me? although there are facilities for it in COPR, and self-deletable packages...)

AldanTanneo avatar Oct 25 '25 17:10 AldanTanneo

It would be nice to have a jj package for fedora! Note that I don't know how the maintainers feel about adding credentials in the github project.

For COPR there are several options available, including adding a webhook to automatically schedule builds on new tags. It would not require credentials in GitHub secrets, and would happen outside of Github actions.

Would that require updating the version in the spec file?

glehmann avatar Oct 26 '25 21:10 glehmann

Would that require updating the version in the spec file?

It can be automated by having a little shell script get the latest tag and parse it (via rpkg macros)

Because the default rpkg macro ({{{ git_dir_version }}} iirc) expects a tag in the form <package_name>-<version>, but this repo has v<version> tags, so you need to do a custom macro

AldanTanneo avatar Oct 26 '25 22:10 AldanTanneo