-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New release workflow #17365
New release workflow #17365
Conversation
Make sure the cache exists before running any git_cache command. This fixes up a couple of places we forgot it, and also allows us to remove the explicit init step from a few others.
The release workflow in Cockpit currently runs as a monolithic job under the "release" environment. cockpit-project/cockpit#17365 changes that, so that each part of the process runs in its own environment and the "release" environment no longer exists. Install the deploy key for the website into the "website" environment instead.
fb672c2
to
a321f08
Compare
Many of our scripts follow the pattern of using something like cd "$(realpath -m $0/../../..)" in order to change to the top source directory. The idea of applying `..` to a regular file (`$0`, the path to the script itself) is a bit weird, but the `realpath -m` (`--canonicalize-missing`) flag allows that by ignoring the content of the filesystem. In effect, the first `..` removes the basename, and then the remaining `../..` express the location of the top directory relative to the directory containing the script. Experiments building Cockpit in container environments have shown that `realpath -m` is non-POSIX. There's an alternative, however, and it has the advantage of not using any external tools at all: we can do the first step of removing the basename by using shell parameter expansion: `"${0%/*}"`. From there, we can just append the correct number of `../..` to get the desired path: cd "${0%/*}/../.." Update this pattern (and similar) in all the scripts which use it.
This has nothing to do with webpack, so it's not clear why it is being put here. Generate it into a subdirectory in doc/guide/. Adjust cockpituous-release accordingly.
Drop the weird thing where we source the 'prepare' script and do some stuff before running the 'prepare' function defined inside of it. This is now a simple script, with two arguments: the source location and the checksum. If the source is unspecified, it will be created. If the checksum is omitted, and the source is local, it will be calculated. The prepare script writes the manifest to the working directory where it was invoked and prints the name of the file to stdout. Adjust containers/flatpak/install for these changes, and take advantage of the fact that the output is now placed in the working directory: change to tmp/ first, and do the build there as well. That lets us clean up some .gitignore noise as well. We drop the update-flathub machinery for now. It'll be brought back very soon as part of a revamped release script.
a321f08
to
1105555
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm looking forward to this!
- name: Verify checksum | ||
run: echo '${{ needs.source.outputs.checksum }} ${{ needs.source.outputs.filename }}' | sha256sum -c | ||
|
||
- name: Build guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer keeping tools/release-guide, and just calling that from the workflow with passing the outputs
variables. It's so much easier to locally run and debug a shell script than a workflow..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to handle this as a follow-up, possibly using the new unit tests container script from #17304.
1105555
to
32423d2
Compare
Now that we're no longer releasing downstream packages or containers as part of our release workflow, our use of cockpituous is starting to look more and more like overkill. Create a new release process based on GitHub actions. We now create the source tarball and draft the release as part of a open-coded job. This job sets the verison number, the download url, and the checksum of the tarball as outputs that can be used from dependent jobs. As dependent jobs, we add two new ones: updating the guide on the website (with logic from `tools/release-guide`) and pushing a branch to flathub with the new manifest (replacing the manual hackish workflow dropped in the last commit).
32423d2
to
62abf98
Compare
The release workflow in Cockpit currently runs as a monolithic job under the "release" environment. cockpit-project/cockpit#17365 changes that, so that each part of the process runs in its own environment and the "release" environment no longer exists. Install the deploy key for the website into the "website" environment instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, as I said the release-guide stuff is more like bikeshedding, let's not block on this.
Go, go, go! 🚀
Let's move away from cockpituous-release and use a workflow instead.
I installed deploy keys into my repository that would allow me to push to various cockpit repos from there, and this worked, and produced commits in the flathub and website repositories properly.
https://github.com/allisonkarlitskaya/cockpit/runs/6531613154?check_suite_focus=true
The release is on my page here: https://github.com/allisonkarlitskaya/cockpit/releases/tag/999
I force-pushed to remove the change to the website.
The branch created by the flathub process is there: https://github.com/cockpit-project/org.cockpit_project.CockpitClient/tree/999
The node-cache thing failed, but only because it tried to push to my fork instead of the cockpit one, and I set the keys up for the cockpit one. I didn't really change anything major there anyway.
I feel reasonably comfortable merging this now.