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

GH-20: Add release scripts #496

Merged
merged 28 commits into from
Jan 13, 2025
Merged

GH-20: Add release scripts #496

merged 28 commits into from
Jan 13, 2025

Conversation

kou
Copy link
Member

@kou kou commented Jan 9, 2025

Fixes GH-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. .github/workflows/release.yml create a GitHub Releases for v${version} tag by copying the RC GitHub Releases
    3. dev/release/release.sh downloads apache-arrow-java-${version}.tar.gz{,.asc,.sha256,.sha512} from GitHub Releases
    4. dev/release/release.sh uploads apache-arrow-java-${version}.tar.gz{,.asc,.sha256,.sha512} to https://dist.apache.org/repos/dist/release/arrow
    5. 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

@kou
Copy link
Member Author

kou commented Jan 9, 2025

I'll test this on my fork.
If you have any concerns for this workflow, please share them.

## Overview

1. Test the revision to be released
2. Bump version by `dev/release/bump_version.sh X.Y.Z`
Copy link
Member

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?

Copy link
Member Author

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.

if [ "${RELEASE_PULL}" -gt 0 ]; then
echo "Ensure using the latest commit"
git checkout main
git pull --rebase --prune
Copy link
Member

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?

Copy link
Member Author

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.

run: |
version=${GITHUB_REF_NAME#v}
gh release create ${GITHUB_REF_NAME} \
--notes "TODO" \
Copy link
Member

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?

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 discuss this as a separated task: #499

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

.github/workflows/rc.yml Show resolved Hide resolved
tag=v${version}
;;
esac
mvn versions:set-scm-tag "-DnewTag=${tag}" -DgenerateBackupPoms=false -pl :arrow-java-root
Copy link
Member

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?

Copy link
Member Author

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:

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

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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."
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

kou added 18 commits January 10, 2025 14:47
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
@kou
Copy link
Member Author

kou commented Jan 10, 2025

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
18.2.0 GitHub Release: https://github.com/kou/arrow-java/releases/tag/v18.2.0

Copy link
Member

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

dev/release/README.md Outdated Show resolved Hide resolved
dev/release/README.md Show resolved Hide resolved
dev/release/README.md Show resolved Hide resolved
dev/release/README.md Show resolved Hide resolved
dev/release/README.md Show resolved Hide resolved
Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kou kou merged commit 14dcd50 into apache:main Jan 13, 2025
21 checks passed
@kou kou deleted the release-script branch January 13, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add release CI
4 participants