Skip to content
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

Merged
merged 5 commits into from
May 23, 2022
Merged

New release workflow #17365

merged 5 commits into from
May 23, 2022

Conversation

allisonkarlitskaya
Copy link
Member

@allisonkarlitskaya allisonkarlitskaya commented May 20, 2022

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.

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.
@allisonkarlitskaya allisonkarlitskaya added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label May 20, 2022
allisonkarlitskaya added a commit to cockpit-project/bots that referenced this pull request May 20, 2022
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.
@allisonkarlitskaya allisonkarlitskaya added the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label May 20, 2022
@allisonkarlitskaya allisonkarlitskaya temporarily deployed to cockpit-dist May 20, 2022 21:09 Inactive
@github-actions github-actions bot removed the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label May 20, 2022
@allisonkarlitskaya allisonkarlitskaya temporarily deployed to cockpit-dist May 20, 2022 21:19 Inactive
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.
@allisonkarlitskaya allisonkarlitskaya temporarily deployed to cockpit-dist May 20, 2022 21:26 Inactive
Copy link
Member

@martinpitt martinpitt left a 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
Copy link
Member

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..

Copy link
Member Author

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.

Copy link
Member Author

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.

@allisonkarlitskaya allisonkarlitskaya temporarily deployed to cockpit-dist May 23, 2022 07:40 Inactive
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).
@allisonkarlitskaya allisonkarlitskaya added the followup Set when merging a PR on the condition that future work is done. Clear when work is complete. label May 23, 2022
allisonkarlitskaya added a commit to cockpit-project/bots that referenced this pull request May 23, 2022
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.
@allisonkarlitskaya allisonkarlitskaya temporarily deployed to cockpit-dist May 23, 2022 09:17 Inactive
@allisonkarlitskaya allisonkarlitskaya added the .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows label May 23, 2022
Copy link
Member

@martinpitt martinpitt left a 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! 🚀

@martinpitt martinpitt added the release-blocker Targetted for next release label May 23, 2022
@martinpitt martinpitt merged commit d212464 into main May 23, 2022
@martinpitt martinpitt deleted the release-workflow branch May 23, 2022 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
followup Set when merging a PR on the condition that future work is done. Clear when work is complete. .github-changes Set by a reviewer just before landing to acknowledge that a PR changes github workflows no-test For doc/workflow changes, or experiments which don't need a full CI run, release-blocker Targetted for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants