Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 148
GH-20: Add release scripts#496
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
bb58b3788a3456b417364c2a91fafed3ea529aa210ed526159a11639191e584ca473de7c51faaf08525bef414bfcf645a6405073e9ff0ff2b736ee2e89edb1eb3c429f996be66402ef4d23d60013df24d711bf2ee59a1b1ab28353784fc634156c80File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| name: RC | ||
| on: | ||
lidavidm marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| push: | ||
| branches: | ||
| - "**" | ||
| - "!dependabot/**" | ||
| tags: | ||
| - "*-rc*" | ||
| pull_request: | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| archive: | ||
| name: Archive | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| submodules: recursive | ||
| - name: Prepare for tag | ||
| if: github.ref_type == 'tag' | ||
| run: | | ||
| version=${GITHUB_REF_NAME%-rc*} | ||
| version=${version#v} | ||
| rc=${GITHUB_REF_NAME#*-rc} | ||
| echo "VERSION=${version}" >> ${GITHUB_ENV} | ||
| echo "RC=${rc}" >> ${GITHUB_ENV} | ||
| - name: Prepare for branch | ||
| if: github.ref_type == 'branch' | ||
| run: | | ||
| version=$(grep -o '^ <version>.*</version>' "pom.xml" | | ||
| sed \ | ||
| -e 's,^ <version>,,' \ | ||
| -e 's,</version>$,,') | ||
| rc=$(date +%Y%m%d) | ||
| echo "VERSION=${version}" >> ${GITHUB_ENV} | ||
| echo "RC=${rc}" >> ${GITHUB_ENV} | ||
| - name: Archive | ||
| run: | | ||
| id="apache-arrow-java-${VERSION}" | ||
| tar_gz="${id}.tar.gz" | ||
| echo "TAR_GZ=${tar_gz}" >> ${GITHUB_ENV} | ||
| git archive HEAD --prefix "${id}/" --output "${tar_gz}" | ||
| sha256sum "${tar_gz}" > "${tar_gz}.sha256" | ||
| sha512sum "${tar_gz}" > "${tar_gz}.sha512" | ||
| - name: Audit | ||
| run: | | ||
| dev/release/run_rat.sh "${TAR_GZ}" | ||
| - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | ||
| with: | ||
| name: archive | ||
| path: | | ||
| apache-arrow-java-* | ||
| verify: | ||
| name: Verify | ||
| needs: | ||
| - archive | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| - macos-latest | ||
| - ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| submodules: recursive | ||
| - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
| with: | ||
| name: archive | ||
| - name: Verify | ||
| run: | | ||
| tar_gz=$(echo apache-arrow-java-*.tar.gz) | ||
| version=${tar_gz#apache-arrow-java-} | ||
| version=${version%.tar.gz} | ||
| # rc isn't used with VERIFY_DOWNLOAD=0 | ||
| if [ "${GITHUB_REF_TYPE}" = "tag" ]; then | ||
| rc="${GITHUB_REF_NAME#*-rc}" | ||
| else | ||
| rc=$(date +%Y%m%d) | ||
| fi | ||
| VERIFY_DEFAULT=0 \ | ||
| VERIFY_SOURCE=1 \ | ||
| dev/release/verify_rc.sh "${version}" "${rc}" | ||
| upload: | ||
| name: Upload | ||
| if: github.ref_type == 'tag' | ||
| needs: | ||
| - verify | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| submodules: recursive | ||
| - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
| with: | ||
| name: archive | ||
| - name: Upload | ||
| run: | | ||
| # GH-499: How to create release notes? | ||
| version=${GITHUB_REF_NAME%-rc*} | ||
| version=${version#v} | ||
| rc=${GITHUB_REF_NAME#*-rc} | ||
| gh release create ${GITHUB_REF_NAME} \ | ||
| --generate-notes \ | ||
| --prerelease \ | ||
| --title "Apache Arrow Java ${version} RC${rc}" \ | ||
| --verify-tag \ | ||
| apache-arrow-java-*.tar.gz \ | ||
| apache-arrow-java-*.tar.gz.sha* | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| name: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - "*" | ||
| - "!*-rc*" | ||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| contents: write | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| jobs: | ||
| publish: | ||
| name: Publish | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Download RC contents | ||
| run: | | ||
| set -x | ||
| latest_rc_tag=$(gh release list --json tagName --jq '.[].tagName' | \ | ||
| grep -F "${GITHUB_REF_NAME}-rc" | \ | ||
| head -n1) | ||
| gh release download ${latest_rc_tag} --dir dists | ||
| - name: Create GitHub Release | ||
| run: | | ||
| # GH-499: How to create release notes? | ||
| version=${GITHUB_REF_NAME#v} | ||
| gh release create ${GITHUB_REF_NAME} \ | ||
| --generate-notes \ | ||
| --title "Apache Arrow Java ${version}" \ | ||
| --verify-tag \ | ||
| dists/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| <!--- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
| # Release | ||
| ## Overview | ||
| 1. Test the revision to be released | ||
| 2. Bump version for new release (detailed later) | ||
| 3. Prepare RC and vote (detailed later) | ||
| 4. Publish (detailed later) | ||
| 5. Bump version for new development (detailed later) | ||
| ### Bump version for new release | ||
| Run `dev/release/bump_version.sh` on a working copy of your fork not | ||
| `git@github.com:apache/arrow-java`: | ||
| ```console | ||
| $ git clone git@github.com:${YOUR_GITHUB_ACCOUNT}/arrow-java.git arrow-java.${YOUR_GITHUB_ACCOUNT} | ||
| $ cd arrow-java.${YOUR_GITHUB_ACCOUNT} | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh ${NEW_VERSION} | ||
| ``` | ||
| Here is an example to bump version to 19.0.0: | ||
| ``` | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh 19.0.0 | ||
| ``` | ||
| It creates a feature branch and adds a commit that bumps version. This | ||
| opens a pull request from the feature branch by `gh pr create`. So you | ||
| need `gh` command and GitHub personal access token. | ||
| See also: | ||
| https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens | ||
raulcd marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| We need to merge the pull request before we cut a RC. If we try cut a | ||
| RC without merging the pull request, the script to cut a RC is failed. | ||
| ### Prepare RC and vote | ||
| Run `dev/release/release_rc.sh` on a working copy of | ||
| `git@github.com:apache/arrow-java` not your fork: | ||
raulcd marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ```console | ||
| $ git clone git@github.com:apache/arrow-java.git | ||
| $ cd arrow-java | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release_rc.sh ${RC} | ||
| (Send a vote email to dev@arrow.apache.org. | ||
| You can use a draft shown by release_rc.sh for the email.) | ||
| ``` | ||
| Here is an example to release RC1: | ||
| ```console | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release_rc.sh 1 | ||
| ``` | ||
| The argument of `release_rc.sh` is the RC number. If RC1 has a | ||
| problem, we'll increment the RC number such as RC2, RC3 and so on. | ||
| Requirements to run `release_rc.sh`: | ||
| * You must be an Apache Arrow committer or PMC member | ||
| * You must prepare your PGP key for signing | ||
| If you don't have a PGP key, | ||
| https://infra.apache.org/release-signing.html#generate may be helpful. | ||
| Your PGP key must be registered to the followings: | ||
| * https://dist.apache.org/repos/dist/dev/arrow/KEYS | ||
| * https://dist.apache.org/repos/dist/release/arrow/KEYS | ||
| See the header comment of them how to add a PGP key. | ||
| Apache arrow committers can update them by Subversion client with | ||
| their ASF account. e.g.: | ||
| ```console | ||
| $ svn co https://dist.apache.org/repos/dist/dev/arrow | ||
raulcd marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| $ cd arrow | ||
| $ head KEYS | ||
| (This shows how to update KEYS) | ||
| $ svn ci KEYS | ||
| ``` | ||
| ### Publish | ||
| We need to do the followings to publish a new release: | ||
| * Publish to apache.org | ||
| Run `dev/release/release.sh` on a working copy of | ||
| `git@github.com:apache/arrow-java` not your fork to publish to | ||
| apache.org: | ||
| ```console | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release.sh ${VERSION} ${RC} | ||
| ``` | ||
| Here is an example to release 19.0.0 RC1: | ||
| ```console | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release.sh 19.0.0 1 | ||
| ``` | ||
| Add the release to ASF's report database via [Apache Committee Report | ||
| Helper](https://reporter.apache.org/addrelease.html?arrow). | ||
raulcd marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ### Bump version for new development | ||
| We should bump version in the main branch for new development after we | ||
| release a new version. | ||
| Run `dev/release/bump_version.sh` on a working copy of your fork not | ||
| `git@github.com:apache/arrow-java`: | ||
| ```console | ||
| $ git clone git@github.com:${YOUR_GITHUB_ACCOUNT}/arrow-java.git arrow-java.${YOUR_GITHUB_ACCOUNT} | ||
| $ cd arrow-java.${YOUR_GITHUB_ACCOUNT} | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh ${NEW_VERSION}-SNAPSHOT | ||
| ``` | ||
| Here is an example to bump version to 19.0.1-SNAPSHOT: | ||
| ``` | ||
| $ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh 19.0.0-SNAPSHOT | ||
| ``` | ||
| It creates a feature branch and adds a commit that bumps version. This | ||
| opens a pull request from the feature branch by `gh pr create`. | ||
| ## Verify | ||
| We have a script to verify a RC. | ||
| You must install the following commands to use the script: | ||
| * `curl` | ||
| * `gpg` | ||
| * `shasum` or `sha256sum`/`sha512sum` | ||
| * `tar` | ||
| To verify a RC, run the following command line: | ||
| ```console | ||
| $ dev/release/verify_rc.sh ${VERSION} ${RC} | ||
| ``` | ||
| Here is an example to verify the release 19.0.0 RC1: | ||
| ```console | ||
| $ dev/release/verify_rc.sh 19.0.0 1 | ||
| ``` | ||
| If the verification is successful, the message `RC looks good!` is shown. | ||
Uh oh!
There was an error while loading. Please reload this page.
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.ymlto 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.