-
Notifications
You must be signed in to change notification settings - Fork 18
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
add release.sh script to generate changelog, release to GH and Dockerhub #107
Conversation
Changelogv2020-06-10core b9977a2..dc0cc14
ocrd_cis a6a2ecd..f2b42d4
workflow-configuration 403ef75..54f8a9e
2020-05-31Update:
Added:
|
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.
The workflow would be:
* Create a PR branch (e.g. `git checkout -b update-$(date +'%Y-%m-%d')`
You mean this as an example, right? I could still name the branch however I want IIUC.
* Update all submodules: `./release.sh update`
IIUC, I can also list the modules to be updated after this command. Or I do the submodule updates myself manually (esp. if I am not interested in a master version, but in feature branches or PR branches), right?
* Manually check/adapt the submodule checkouts for consistency
You mean after committing, right? I ask because our Makefile rules will immediately reset the worktree to HEAD.
* Open the PR and wait for CI
…after pushing, of course.
The following parts can only be done by collaborators, of course:
* **Do not merge on GitHub**, but locally: `git checkout master; git merge update-....`
you mean git merge --no-commit pr-branch
, right? (This is crucial, because with autocommit the subsequent steps won't see any status changes in the submodules.)
* Generate the CHANGELOG.md: `./release.sh changelog`
…and afterwards validate that this looks correct by git diff CHANGELOG.md HEAD
, right?
* Release to GitHub: `./release.sh release-github` (which will commit the changelog with commit message `:package: $version`, tag that commit as `$version`, push branch and tag to GitHub). This will trigger the Circle CI deploy script which will, after building/pushing all the min/med/max/git/non-git images, tag the `ocrd/all:maximum` image as `ocrd:all:$version` and push to Dockerhub).
Ok, so in summary:
- What will change for contributors?
Nothing. (This is good!) - What will change for collaborators who want to merge PRs?
They will have to apply the PR locally throughrelease.sh
, using their clone's working directory a lot (so they must be careful aboutlocal.mk
or shell variables deactivating components) and downloading all submodules. This is not a big change for their own PRs, but a little extra effort for foreign PRs.
However, this process is still opt-in, i.e. as long as we don't forbid merging on Github UI altogether, one can still use the same procedure as before (esp. for small PRs which only change the README or ocrd_all Makefile) – this won't trigger a git tag or GH release or CHANGELOG update. It will trigger a Docker alias for the current date, though.
Good work!
Yes, branch name is arbitrary and not used in the script.
Yes, that's what I meant with
The
Yes, after comimitting.
Yes (I'll update the initial post shortly).
You're right.
Yes, also probably delete merge commits to keep it concise.
Yes, this requires some work for maintainers and is not integrated into GitHub. I considered using GitHub actions / GitHub API for this but that would require much more work than a shell script and clear conventions. Not saying that it might not be worth the effort in the future but let's see how well the local-shell-script-approach works first. |
We could adapt the Circle CI script to only run if Makefile or submodules have changed. But I doubt it's worth the possible side-effects over manually stopping unnecessary Circle CI builds |
I meant this as a mere observation. In fact, I think this (also) is a good thing: Docker alias and Dockerhub push can be repeated as often as necessary. For example, one might need to merge multiple PRs on one day, or amend a wrong previous version |
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.
Could you copy these guidelines somewhere permanent, maybe in a PR template?
I added contributing guidelines. GitHub will show a sidebar notifying users of them if they open PR/Issues, also linked in the README. |
This all has turned out very well – is there anything more to do before merging? @kba are you waiting on more reviews? |
I requested one @stweil to make sure he's on board with the PR, maybe he missed it. If I don't hear anything to the contrary, I will merge it later today. I really want to try out, if all of this actually works :) |
How to create PR for updated submodules
git checkout -b update-$(date +'%Y-%m-%d')
all submodules to the latest upstream versions, run
./release.sh update
. Toupdate only a specific submodule, such as
ocrd_cis
, run./release.sh update ocrd_cis
. Or update individual submodules manually:cd <submodule>; git pull origin master
(replacemaster
if you want to merge another branch instead)git status
that the changes are consistent with whatyou want to update in the PR.
git add
/git commit
git push
to yourocrd_all
fork on GitHubgit push
request will show you the right URL)How to merge update PR for updated submodules
maximum
image can be built)master
branch locally,git pull
to make sure it's up-to-date.--no-commit
flag so the merge commit doesn't hide the changes:git merge --no-commit pr-branch
./release.sh changelog
../release.sh release-github
. This will take care of comitting, tagging and pushing the release.