-
Notifications
You must be signed in to change notification settings - Fork 21
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
GH-20: Add release scripts #496
Conversation
I'll test this on my fork. |
dev/release/README.md
Outdated
## Overview | ||
|
||
1. Test the revision to be released | ||
2. Bump version by `dev/release/bump_version.sh X.Y.Z` |
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 script appears to create a PR, let's be explicit that the PR should be merged and then the release script should be run from that commit?
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.
It makes sense.
I'll do it.
dev/release/release_rc.sh
Outdated
if [ "${RELEASE_PULL}" -gt 0 ]; then | ||
echo "Ensure using the latest commit" | ||
git checkout main | ||
git pull --rebase --prune |
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.
Hmm, wouldn't --ff-only
be better in case there's an unpushed local commit for some reason?
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.
Good catch! We should use --ff-only
here. I'll fix this.
.github/workflows/release.yml
Outdated
run: | | ||
version=${GITHUB_REF_NAME#v} | ||
gh release create ${GITHUB_REF_NAME} \ | ||
--notes "TODO" \ |
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 suppose we should consider something like conventional commits for this repo too? Or else manually curate a CHANGELOG.md?
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 discuss this as a separated task: #499
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 suppose at some point we should refactor the JNI build so we can include binary artifacts here too.
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.
Ah, it's a good idea!
Can I merge the existing test_jni.yml
to here?
Or should we keep these workflows separated?
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 don't think we need to tackle this right away. GitHub lets you run actions as a substep, so maybe we can run test_jni.yml as a substep, then pull the artifacts back into the release pipeline.
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.
Are you thinking about a composite action (e.g. we're using it in apache/arrow: https://github.com/apache/arrow/tree/main/.github/actions/sync-nightlies ) or reusable workflow?
Anyway, lets' defer this: GH-500
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 was thinking reusable workflow, but either way works for me - I just mean there's no need to merge/duplicate the pipelines. I'm OK with deferring it, yes.
tag=v${version} | ||
;; | ||
esac | ||
mvn versions:set-scm-tag "-DnewTag=${tag}" -DgenerateBackupPoms=false -pl :arrow-java-root |
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.
Why do we need set-scm-tag for SNAPSHOT
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.
Because we don't create a branch for release in the proposed workflow.
My understanding is that this updates project.scm.tag
:
Line 84 in 4a535af
<tag>main</tag> |
pom.xml
in the main branch uses vX.Y.Z
while we're releasing. We need to back it to main
after we released X.Y.Z
.
Do we want to create a release branch? If we have a release branch, we don't need to back it to main
because pom.xml
in the main
branch always uses main
for project.scm.tag
. pom.xml
in release branches use vX.Y.Z
for project.scm.tag
.
(If we create a release branch, release process will be a bit complex.)
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.
If we want to follow up with a 19.0.1 release to fix issues in 19.0.0, does it mean that we have to create the RC from main branch too?
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.
Yes.
FYI: apache/arrow-julia and apache/arrow-go use this style.
If we have enough resource to maintain multiple major releases (e.g. 18.Y.Z and 19.Y.Z), we can create a release branch for each major release. But I think that we don't have enough resource for now...
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.
Agreed. Let's not over-complicate the script for now.
if [ "${RELEASE_PULL}" -gt 0 ] || [ "${RELEASE_PUSH_TAG}" -gt 0 ]; then | ||
git_origin_url="$(git remote get-url origin)" | ||
if [ "${git_origin_url}" != "[email protected]:apache/arrow-java.git" ]; then | ||
echo "This script must be ran with working copy of apache/arrow-java." |
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.
Should we also add that it cannot accept https mode?
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.
Are you (and other commiters/PMC members who may become a release manager) using https://
for writable clone?
If so, let's accept https://
too.
FYI: I'm using https://
for read-only clones.
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.
Usually I use https://
to git clone a large repo in the beginning which becomes the origin
remote by default. I can manually switch origin
to use ssh
to avoid complication here.
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.
OK. Let's accept https://
too.
It will not be too complex.
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 was thinking reusable workflow, but either way works for me - I just mean there's no need to merge/duplicate the pipelines. I'm OK with deferring it, yes.
Fixes apacheGH-20. This is based on apache/arrow-go#122 . Workflow: Cut a RC: 1. Bump version by `dev/release/bump_version.sh 19.0.0` 2. Run `dev/release/release_rc.sh` 1. `dev/release/release_rc.sh` pushes `v${version}-rc${rc}` tag 2. `.github/workflows/rc.yml` creates `apache-arrow-java-${version}.tar.gz{,.sha256,.sha512}` 3. `.github/workflows/rc.yml` uploads `apache-arrow-java-${version}.tar.gz{,.sha256,.sha512}` to GitHub Releases 4. `dev/release/release_rc.sh` downloads `apache-arrow-java-${version}.tar.gz` from GitHub Releases 5. `dev/release/release_rc.sh` signs `apache-arrow-java-${version}.tar.gz` as `apache-arrow-go-${version}.tar.gz.asc` 6. `dev/release/release_rc.sh` uploads `apache-arrow-java-${version}.tar.gz.asc` to GitHub Releases 3. Start a vote (GitHub Actions instead of https://dist.apache.org/repos/dist/dev/arrow/ is used like ADBC.) Verify a RC: 1. Run `dev/release/verify_rc.sh` Release an approved RC: 1. Run `dev/release/release.sh` 1. `dev/release/release.sh` pushes `v${version}` tag that refers that same commit ID as `v${version}-rc${rc}` 2. `dev/release/release.sh` downloads `apache-arrow-java-${version}.tar.gz{,.asc,.sha256,.sha512}` from GitHub Actions 3. `dev/release/release.sh` uploads `apache-arrow-java-${version}.tar.gz{,.asc,.sha256,.sha512}` to https://dist.apache.org/repos/dist/release/arrow 4. `dev/release/release.sh` removes old releases from https://dist.apache.org/repos/dist/release/arrow 2. Add this release to ASF's report database: https://reporter.apache.org/addrelease.html?arrow Follow-up tasks: * Add support for building binary packages (.jar) * Add support for releasing binary packages (.jar) * Add support for running JNI test in the verification script * Add support for running integration test in the verification script * Add support for verifying binary packages (.jar) in the verification script * Add support for releasing a release note
I tried the workflow on my fork. It worked with some fixes. 18.2.0 RC0 GitHub Release: https://github.com/kou/arrow-java/releases/tag/v18.2.0-rc0 |
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 @kou ! Looks great!
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.
👍
Fixes GH-20.
This is based on apache/arrow-go#122 .
Workflow:
Cut a RC:
dev/release/bump_version.sh 19.0.0
dev/release/release_rc.sh
dev/release/release_rc.sh
pushesv${version}-rc${rc}
tag.github/workflows/rc.yml
createsapache-arrow-java-${version}.tar.gz{,.sha256,.sha512}
.github/workflows/rc.yml
uploadsapache-arrow-java-${version}.tar.gz{,.sha256,.sha512}
to GitHub Releasesdev/release/release_rc.sh
downloadsapache-arrow-java-${version}.tar.gz
from GitHub Releasesdev/release/release_rc.sh
signsapache-arrow-java-${version}.tar.gz
asapache-arrow-go-${version}.tar.gz.asc
dev/release/release_rc.sh
uploadsapache-arrow-java-${version}.tar.gz.asc
to GitHub Releases(GitHub Actions instead of
https://dist.apache.org/repos/dist/dev/arrow/ is used like ADBC.)
Verify a RC:
dev/release/verify_rc.sh
Release an approved RC:
dev/release/release.sh
dev/release/release.sh
pushesv${version}
tag that refers that same commit ID asv${version}-rc${rc}
.github/workflows/release.yml
create a GitHub Releases forv${version}
tag by copying the RC GitHub Releasesdev/release/release.sh
downloadsapache-arrow-java-${version}.tar.gz{,.asc,.sha256,.sha512}
from GitHub Releasesdev/release/release.sh
uploadsapache-arrow-java-${version}.tar.gz{,.asc,.sha256,.sha512}
to https://dist.apache.org/repos/dist/release/arrowdev/release/release.sh
removes old releases from https://dist.apache.org/repos/dist/release/arrowFollow-up tasks: