diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 3de38eea84..5312f0f13e 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -302,8 +302,14 @@ jobs: - name: Extract source archive run: | tar xf apache-arrow-adbc-${{ steps.info.outputs.VERSION }}.tar.gz + + source ./apache-arrow-adbc-${{ steps.info.outputs.VERSION }}/dev/release/versions.env + mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }} adbc - mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }}.tar.gz adbc/ci/linux-packages/ + # Need to align the file path with the version number (and not the release) + cp -r adbc apache-arrow-adbc-${VERSION_NATIVE} + tar czf adbc/ci/linux-packages/apache-arrow-adbc-${VERSION_NATIVE}.tar.gz apache-arrow-adbc-${VERSION_NATIVE} + echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -527,7 +533,8 @@ jobs: strategy: fail-fast: false matrix: - arch: ["amd64", "arm64v8"] + # XXX(lidavidm): disable arm64 build for now while I test things + arch: ["amd64"] manylinux_version: ["2014"] is_pr: - ${{ startsWith(github.ref, 'refs/pull/') }} @@ -546,12 +553,13 @@ jobs: source_archive=$(echo apache-arrow-adbc-*.tar.gz) VERSION=${source_archive#apache-arrow-adbc-} VERSION=${VERSION%.tar.gz} - echo "VERSION=${VERSION}" >> $GITHUB_ENV - echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" tar xf apache-arrow-adbc-${VERSION}.tar.gz mv apache-arrow-adbc-${VERSION} adbc + source adbc/dev/release/versions.env + echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV + - name: Show inputs run: | echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY @@ -654,12 +662,14 @@ jobs: source_archive=$(echo apache-arrow-adbc-*.tar.gz) VERSION=${source_archive#apache-arrow-adbc-} VERSION=${VERSION%.tar.gz} - echo "VERSION=${VERSION}" >> $GITHUB_ENV - echo "SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}" >> $GITHUB_ENV tar xf apache-arrow-adbc-${VERSION}.tar.gz mv apache-arrow-adbc-${VERSION} adbc + source adbc/dev/release/versions.env + echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV + echo "SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV + - name: Show inputs run: | echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" >> $GITHUB_STEP_SUMMARY @@ -805,12 +815,13 @@ jobs: source_archive=$(echo apache-arrow-adbc-*.tar.gz) VERSION=${source_archive#apache-arrow-adbc-} VERSION=${VERSION%.tar.gz} - echo "VERSION=${VERSION}" >> $GITHUB_ENV - echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" tar xf apache-arrow-adbc-${VERSION}.tar.gz mv apache-arrow-adbc-${VERSION} adbc + source adbc/dev/release/versions.env + echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV + (. adbc/.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV - name: Show inputs @@ -903,12 +914,13 @@ jobs: source_archive=$(echo apache-arrow-adbc-*.tar.gz) VERSION=${source_archive#apache-arrow-adbc-} VERSION=${VERSION%.tar.gz} - echo "VERSION=${VERSION}" >> $GITHUB_ENV - echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" tar xf apache-arrow-adbc-${VERSION}.tar.gz mv apache-arrow-adbc-${VERSION} adbc + source adbc/dev/release/versions.env + echo "VERSION=${VERSION_NATIVE}" | tee -a $GITHUB_ENV + - name: Show inputs run: | echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}" diff --git a/dev/release/01-prepare.sh b/dev/release/01-prepare.sh index 7dab7968e0..7beb806372 100755 --- a/dev/release/01-prepare.sh +++ b/dev/release/01-prepare.sh @@ -20,60 +20,61 @@ set -ue SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "$SOURCE_DIR/utils-common.sh" +source "$SOURCE_DIR/utils-prepare.sh" -if [ "$#" -ne 5 ]; then - echo "Usage: $0 " - echo "Usage: $0 ../arrow 0.1.0 0.2.0 0.3.0 0" - exit 1 -fi +main() { + if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + echo "Usage: $0 ../arrow 0" + exit 1 + fi -. $SOURCE_DIR/utils-prepare.sh + local -r arrow_dir="$1" + local -r rc_number="$2" + local -r release_candidate_tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" -arrow_dir=$1 -prev_version=$2 -version=$3 -next_version=$4 -next_version_snapshot="${next_version}-SNAPSHOT" -rc_number=$5 + export ARROW_SOURCE="$(cd "${arrow_dir}" && pwd)" -export ARROW_SOURCE="$(cd "${arrow_dir}" && pwd)" + if [[ $(git tag -l "${release_candidate_tag}") ]]; then + local -r next_rc_number=$(($rc_number+1)) + echo "Tag ${release_candidate_tag} already exists, so create a new release candidate:" + echo "1. Create or checkout maint-." + echo "2. Execute the script again with bumped RC number." + echo "Commands:" + echo " git checkout maint-${version}" + echo " dev/release/01-prepare.sh ${arrow_dir} ${next_rc_number}" + exit 1 + fi -release_candidate_tag="apache-arrow-adbc-${version}-rc${rc_number}" + ############################## Pre-Tag Commits ############################## -if [[ $(git tag -l "${release_candidate_tag}") ]]; then - next_rc_number=$(($rc_number+1)) - echo "Tag ${release_candidate_tag} already exists, so create a new release candidate:" - echo "1. Create or checkout maint-." - echo "2. Execute the script again with bumped RC number." - echo "Commands:" - echo " git checkout maint-${version}" - echo " dev/release/01-prepare.sh ${version} ${next_version} ${next_rc_number}" - exit 1 -fi + header "Updating changelog for ${RELEASE}" + # Update changelog + # XXX: commitizen doesn't respect --tag-format with --incremental, so mimic + # it by hand. + ( + echo ; + # Strip trailing blank line + printf '%s\n' "$(cz ch --dry-run --unreleased-version "ADBC Libraries ${RELEASE}" --start-rev apache-arrow-adbc-${PREVIOUS_RELEASE})" + ) >> ${SOURCE_DIR}/../../CHANGELOG.md + git add ${SOURCE_DIR}/../../CHANGELOG.md + git commit -m "chore: update CHANGELOG.md for ${RELEASE}" -############################## Pre-Tag Commits ############################## + header "Prepare release ${RELEASE} on tag ${release_candidate_tag}" -echo "Updating changelog for $version" -# Update changelog -# XXX: commitizen doesn't respect --tag-format with --incremental, so mimic -# it by hand. -( - echo ; - # Strip trailing blank line - printf '%s\n' "$(cz ch --dry-run --unreleased-version "ADBC Libraries ${version}" --start-rev apache-arrow-adbc-${prev_version})" -) >> ${SOURCE_DIR}/../../CHANGELOG.md -git add ${SOURCE_DIR}/../../CHANGELOG.md -git commit -m "chore: update CHANGELOG.md for $version" + update_versions "release" + # --allow-empty required for RCs after the first + git commit -m "chore: update versions for ${RELEASE}" --allow-empty -echo "Prepare release ${version} on tag ${release_candidate_tag}" + ######################### Tag the Release Candidate ######################### -update_versions "${version}" "${next_version}" "release" -# --allow-empty required for RCs after the first -git commit -m "chore: update versions for ${version}" --allow-empty + header "Tag the release candidate ${release_candidate_tag}" -######################### Tag the Release Candidate ######################### + git tag -a "${release_candidate_tag}" -m "ADBC Libraries ${RELEASE} RC ${rc_number}" -git tag -a "${release_candidate_tag}" -m "ADBC Libraries ${version} RC ${rc_number}" + echo "Created release candidate tag: ${release_candidate_tag}" + echo "Push this tag before continuing!" +} -echo "Created release candidate tag: ${release_candidate_tag}" -echo "Push this tag before continuing!" +main "$@" diff --git a/dev/release/02-sign.sh b/dev/release/02-sign.sh index 2eb8dce5c0..1bc0673949 100755 --- a/dev/release/02-sign.sh +++ b/dev/release/02-sign.sh @@ -18,30 +18,21 @@ set -eu -main() { - local -r source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - local -r source_top_dir="$( cd "${source_dir}/../../" && pwd )" - pushd "${source_top_dir}" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - if [ "$#" -ne 3 ]; then - echo "Usage: $0 " +main() { + if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + echo "Usage: $0 0" exit 1 fi - local -r prev_version="$1" - local -r version="$2" - local -r rc_number="$3" - local -r tag="apache-arrow-adbc-${version}-rc${rc_number}" - local -r tarball="apache-arrow-adbc-${version}" + pushd "${SOURCE_TOP_DIR}" - : ${REPOSITORY:="apache/arrow-adbc"} - - if [[ ! -f "${source_dir}/.env" ]]; then - echo "You must create ${source_dir}/.env" - echo "You can use ${source_dir}/.env.example as a template" - fi - - source "${source_dir}/.env" + local -r rc_number="$1" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" header "Looking for GitHub Actions workflow on ${REPOSITORY}:${tag}" local run_id="" @@ -72,7 +63,7 @@ main() { header "Adding release notes" # XXX: commitizen likes to include the entire history even if we # give it a tag, so we have to give it both tags explicitly - local -r release_notes=$(cz ch --dry-run --unreleased-version "ADBC Libraries ${version}" --start-rev apache-arrow-adbc-${prev_version}) + local -r release_notes=$(cz ch --dry-run --unreleased-version "ADBC Libraries ${RELEASE}" --start-rev apache-arrow-adbc-${PREVIOUS_RELEASE}) echo "${release_notes}" gh release edit \ "${tag}" \ @@ -97,12 +88,6 @@ main() { popd } -header() { - echo "============================================================" - echo "${1}" - echo "============================================================" -} - sign_asset() { local -r asset="$1" local -r sigfile="${asset}.asc" diff --git a/dev/release/03-source.sh b/dev/release/03-source.sh index 286d4a7ae8..4f55511a68 100755 --- a/dev/release/03-source.sh +++ b/dev/release/03-source.sh @@ -18,27 +18,19 @@ set -eu -main() { - local -r source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - local -r source_top_dir="$( cd "${source_dir}/../../" && pwd )" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - if [ "$#" -ne 2 ]; then - echo "Usage: $0 " +main() { + if [ "$#" -ne 1 ]; then + echo "Usage: $0 " exit 1 fi - local -r version="$1" - local -r rc_number="$2" - local -r tag="apache-arrow-adbc-${version}-rc${rc_number}" - local -r tarball="apache-arrow-adbc-${version}.tar.gz" - - : ${REPOSITORY:="apache/arrow-adbc"} - - if [[ ! -f "${source_dir}/.env" ]]; then - echo "You must create ${source_dir}/.env" - echo "You can use ${source_dir}/.env.example as a template" - fi - source "${source_dir}/.env" + local -r rc_number="$1" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" + local -r tarball="apache-arrow-adbc-${RELEASE}.tar.gz" header "Downloading assets from release" local -r download_dir="packages/${tag}" @@ -63,7 +55,11 @@ main() { # commit to svn svn add "tmp/${tag}" - svn ci -m "Apache Arrow ADBC ${version} RC${rc_number}" "tmp/${tag}" + if [[ "${DRY_RUN}" = 0 ]]; then + svn ci -m "Apache Arrow ADBC ${version} RC${rc_number}" "tmp/${tag}" + else + echo "Dry run: not committing to dist.apache.org" + fi # clean up rm -rf tmp @@ -71,10 +67,4 @@ main() { echo "Uploaded at https://dist.apache.org/repos/dist/dev/arrow/${tag}" } -header() { - echo "============================================================" - echo "${1}" - echo "============================================================" -} - main "$@" diff --git a/dev/release/04-java-upload.sh b/dev/release/04-java-upload.sh index f7606bb080..8315d7a2f7 100755 --- a/dev/release/04-java-upload.sh +++ b/dev/release/04-java-upload.sh @@ -21,22 +21,20 @@ set -e set -u set -o pipefail -main() { - local -r source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - local -r source_top_dir="$(cd "${source_dir}/../../" && pwd)" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - if [ $# -ne 3 ]; then - echo "Usage: $0 " - echo "Usage: $0 ../arrow 1.0.0 0" +main() { + if [ $# -ne 2 ]; then + echo "Usage: $0 " + echo "Usage: $0 ../arrow 0" exit fi local -r arrow_dir="$(cd "$1" && pwd)" - local -r version="$2" - local -r rc_number="$3" - local -r tag="apache-arrow-adbc-${version}-rc${rc_number}" - - : ${REPOSITORY:="apache/arrow-adbc"} + local -r rc_number="$2" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" export ARROW_ARTIFACTS_DIR="$(pwd)/packages/${tag}/java" rm -rf "${ARROW_ARTIFACTS_DIR}" @@ -51,7 +49,7 @@ main() { "${tag}" export UPLOAD_FORCE_SIGN=0 - "${arrow_dir}/dev/release/06-java-upload.sh" "${version}" "${rc_number}" + "${arrow_dir}/dev/release/06-java-upload.sh" "${RELEASE}" "${rc_number}" } main "$@" diff --git a/dev/release/06-binary-verify.sh b/dev/release/06-binary-verify.sh index 2a9aad46e4..13a76d6acd 100755 --- a/dev/release/06-binary-verify.sh +++ b/dev/release/06-binary-verify.sh @@ -18,27 +18,27 @@ set -euo pipefail -main() { - local -r source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - local -r source_top_dir="$( cd "${source_dir}/../../" && pwd )" - - local -r version="$1" - local -r rc_number="$2" - local -r tag="apache-arrow-adbc-${version}-rc${rc_number}" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - : ${WORKFLOW_REF:="main"} - : ${REPOSITORY:="apache/arrow-adbc"} +main() { + if [ $# -ne 1 ]; then + echo "Usage: $0 " + echo "Usage: $0 0" + exit + fi - export SOURCE_DIR="${source_dir}" - source "${source_top_dir}/dev/release/utils-prepare.sh" + local -r rc_number="$1" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" - echo "Starting GitHub Actions workflow on ${REPOSITORY} for ${version} RC${rc_number}" + echo "Starting GitHub Actions workflow on ${REPOSITORY} for ${RELEASE} RC${rc_number}" gh workflow run \ --repo "${REPOSITORY}" \ --ref "${WORKFLOW_REF}" \ verify.yml \ - --raw-field version="${version}" \ + --raw-field version="${RELEASE}" \ --raw-field rc="${rc_number}" local run_id="" @@ -56,7 +56,7 @@ main() { echo "Started GitHub Actions workflow with ID: ${run_id}" echo "You can wait for completion via: gh run watch --repo ${REPOSITORY} ${run_id}" - set_resolved_issues "${version}" + set_resolved_issues "${RELEASE}" echo "The following draft email has been created to send to the" echo "dev@arrow.apache.org mailing list" @@ -67,7 +67,7 @@ main() { cat < " + if [ "$#" -ne 1 ]; then + echo "Usage: $0 " exit 1 fi - local -r version="$1" - local -r rc_number="$2" - local -r tag="apache-arrow-adbc-${version}-rc${rc_number}" + local -r rc_number="$1" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" - rc_id="apache-arrow-adbc-${version}-rc${rc_number}" - release_id="apache-arrow-adbc-${version}" + rc_id="apache-arrow-adbc-${RELEASE}-rc${rc_number}" + release_id="apache-arrow-adbc-${RELEASE}" echo "Copying dev/ to release/" svn \ cp \ - -m "Apache Arrow ADBC ${version}" \ + -m "Apache Arrow ADBC ${RELEASE}" \ https://dist.apache.org/repos/dist/dev/arrow/${rc_id} \ https://dist.apache.org/repos/dist/release/arrow/${release_id} echo "Create final tag" - git tag -a "apache-arrow-adbc-${version}" -m "ADBC Libraries ${version}" "${tag}^{}" + git tag -a "apache-arrow-adbc-${RELEASE}" -m "ADBC Libraries ${RELEASE}" "${tag}^{}" echo "Success! The release is available here:" echo " https://dist.apache.org/repos/dist/release/arrow/${release_id}" - echo "Please push the tag apache-arrow-adbc-${version}!" + echo "Please push the tag apache-arrow-adbc-${RELEASE}!" } main "$@" diff --git a/dev/release/post-02-binary.sh b/dev/release/post-02-binary.sh index 16a484aea9..cdeff62ede 100755 --- a/dev/release/post-02-binary.sh +++ b/dev/release/post-02-binary.sh @@ -21,36 +21,27 @@ set -e set -u set -o pipefail -main() { - local -r source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - local -r source_top_dir="$( cd "${source_dir}/../../" && pwd )" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - if [ "$#" -ne 2 ]; then - echo "Usage: $0 " +main() { + if [ "$#" -ne 1 ]; then + echo "Usage: $0 " exit 1 fi + local -r rc_number="$1" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" - local -r version="$1" - local -r rc_number="$2" - local -r tag="apache-arrow-adbc-${version}-rc${rc_number}" - - : ${REPOSITORY:="apache/arrow-adbc"} - - header "Publishing release ${version}" + header "Publishing release ${RELEASE}" gh release edit \ --verify-tag \ --repo "${REPOSITORY}" \ "${tag}" \ - --title="ADBC Libraries ${version}" \ + --title="ADBC Libraries ${RELEASE}" \ --prerelease=false \ - --tag="apache-arrow-adbc-${version}" -} - -header() { - echo "============================================================" - echo "${1}" - echo "============================================================" + --tag="apache-arrow-adbc-${RELEASE}" } main "$@" diff --git a/dev/release/post-03-python.sh b/dev/release/post-03-python.sh index 40e5559927..cd13b5c647 100755 --- a/dev/release/post-03-python.sh +++ b/dev/release/post-03-python.sh @@ -21,24 +21,21 @@ set -e set -u set -o pipefail -main() { - local -r source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - local -r source_top_dir="$( cd "${source_dir}/../../" && pwd )" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - if [ "$#" -ne 2 ]; then - echo "Usage: $0 " +main() { + if [ "$#" -ne 1 ]; then + echo "Usage: $0 " exit 1 fi - - local -r version="$1" - local -r rc_number="$2" - local -r tag="apache-arrow-adbc-${version}" - - : ${REPOSITORY:="apache/arrow-adbc"} + local -r rc_number="$1" + local -r tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" local -r tmp=$(mktemp -d -t "arrow-post-python.XXXXX") - header "Downloading Python packages for ${version}" + header "Downloading Python packages for ${RELEASE}" gh release download \ --repo "${REPOSITORY}" \ @@ -47,7 +44,7 @@ main() { --pattern "*.whl" \ --pattern "adbc_*.tar.gz" # sdist - header "Uploading Python packages for ${version}" + header "Uploading Python packages for ${RELEASE}" TWINE_ARGS="" if [ "${TEST_PYPI:-0}" -gt 0 ]; then @@ -62,10 +59,4 @@ main() { echo "Success!" } -header() { - echo "============================================================" - echo "${1}" - echo "============================================================" -} - main "$@" diff --git a/dev/release/post-04-go.sh b/dev/release/post-04-go.sh index 0ecb99f230..e623fccca9 100755 --- a/dev/release/post-04-go.sh +++ b/dev/release/post-04-go.sh @@ -16,19 +16,30 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# -set -ue + +set -e +set -u +set -o pipefail SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" + +main() { + if [ "$#" -ne 0 ]; then + echo "Usage: $0" + exit 1 + fi + + header "Tagging Go release ${RELEASE}" -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - exit -fi + version_tag="apache-arrow-adbc-${VERSION_NATIVE}" + go_arrow_tag="go/adbc/v${VERSION_NATIVE}" -version=$1 -version_tag="apache-arrow-adbc-${version}" -go_arrow_tag="go/adbc/v${version}" + git tag "${go_arrow_tag}" "${version_tag}" + echo "Created tag ${go_arrow_tag}" + echo "Please verify and push the tag:" + echo git push apache "${go_arrow_tag}" +} -git tag "${go_arrow_tag}" "${version_tag}" -git push apache "${go_arrow_tag}" +main "$@" diff --git a/dev/release/post-05-linux.sh b/dev/release/post-05-linux.sh index 837527dd6d..2cc6a3a4f3 100755 --- a/dev/release/post-05-linux.sh +++ b/dev/release/post-05-linux.sh @@ -21,35 +21,27 @@ set -e set -u set -o pipefail -main() { - local -r source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - local -r source_top_dir="$( cd "${source_dir}/../../" && pwd )" +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" - if [ "$#" -ne 3 ]; then - echo "Usage: $0 " - echo "Usage: $0 ../arrow 1.0.0 0" +main() { + if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + echo "Usage: $0 ../arrow 0" exit 1 fi local -r arrow_dir="$(cd "$1" && pwd)" - local -r version="$2" - local -r rc_number="$3" - - : ${REPOSITORY:="apache/arrow-adbc"} + local -r rc_number="$2" - header "Deploying APT/Yum repositories ${version}" + header "Deploying APT/Yum repositories ${RELEASE}" export DEPLOY_DEFAULT=0 export DEPLOY_ALMALINUX=${DEPLOY_ALMALINUX:-1} export DEPLOY_DEBIAN=${DEPLOY_DEBIAN:-1} export DEPLOY_UBUNTU=${DEPLOY_UBUNTU:-1} - "${arrow_dir}/dev/release/post-02-binary.sh" "${version}" "${rc_number}" -} - -header() { - echo "============================================================" - echo "${1}" - echo "============================================================" + "${arrow_dir}/dev/release/post-02-binary.sh" "${RELEASE}" "${rc_number}" } main "$@" diff --git a/dev/release/post-06-ruby.sh b/dev/release/post-06-ruby.sh index 56a5589683..cb7c79ed45 100755 --- a/dev/release/post-06-ruby.sh +++ b/dev/release/post-06-ruby.sh @@ -21,24 +21,24 @@ set -e set -u set -o pipefail +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" + main() { - if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - echo "Usage: $0 1.0.0" + if [ "$#" -ne 0 ]; then + echo "Usage: $0" exit 1 fi - local -r version="$1" - - archive_name=apache-arrow-adbc-${version} - - tar_gz=${archive_name}.tar.gz + local -r archive_name=apache-arrow-adbc-${RELEASE} + local -r tar_gz=${archive_name}.tar.gz rm -f ${tar_gz} curl \ --remote-name \ --fail \ - https://downloads.apache.org/arrow/apache-arrow-adbc-${version}/${tar_gz} + https://downloads.apache.org/arrow/apache-arrow-adbc-${RELEASE}/${tar_gz} rm -rf ${archive_name} tar xf ${tar_gz} @@ -53,7 +53,7 @@ main() { rm -f ${tar_gz} echo "Success! The released RubyGems are available here:" - echo " https://rubygems.org/gems/red-adbc/versions/${version}" + echo " https://rubygems.org/gems/red-adbc/versions/${VERSION_NATIVE}" } main "$@" diff --git a/dev/release/post-07-csharp.sh b/dev/release/post-07-csharp.sh index 11e66f3846..3bc01eaabb 100755 --- a/dev/release/post-07-csharp.sh +++ b/dev/release/post-07-csharp.sh @@ -24,24 +24,21 @@ set -u set -o pipefail main() { - if [ "$#" -ne 1 ]; then - echo "Usage: $0 " + if [ "$#" -ne 0 ]; then + echo "Usage: $0" exit fi - local -r version="$1" - local -r tag="apache-arrow-adbc-${version}" + local -r tag="apache-arrow-adbc-${RELEASE}" if [ -z "${NUGET_API_KEY}" ]; then echo "NUGET_API_KEY is empty" exit 1 fi - : ${REPOSITORY:="apache/arrow-adbc"} - local -r tmp=$(mktemp -d -t "arrow-post-csharp.XXXXX") - header "Downloading C# packages for ${version}" + header "Downloading C# packages for ${VERSION_CSHARP}" gh release download \ --repo "${REPOSITORY}" \ @@ -51,11 +48,11 @@ main() { --pattern "*.snupkg" local base_names=() - base_names+=(Apache.Arrow.Adbc.${version}) - base_names+=(Apache.Arrow.Adbc.Client.${version}) - base_names+=(Apache.Arrow.Adbc.Drivers.BigQuery.${version}) - base_names+=(Apache.Arrow.Adbc.Drivers.FlightSql.${version}) - base_names+=(Apache.Arrow.Adbc.Drivers.Interop.Snowflake.${version}) + base_names+=(Apache.Arrow.Adbc.${VERSION_CSHARP}) + base_names+=(Apache.Arrow.Adbc.Client.${VERSION_CSHARP}) + base_names+=(Apache.Arrow.Adbc.Drivers.BigQuery.${VERSION_CSHARP}) + base_names+=(Apache.Arrow.Adbc.Drivers.FlightSql.${VERSION_CSHARP}) + base_names+=(Apache.Arrow.Adbc.Drivers.Interop.Snowflake.${VERSION_CSHARP}) for base_name in "${base_names[@]}"; do dotnet nuget push \ "${tmp}/${base_name}.nupkg" \ @@ -66,13 +63,7 @@ main() { rm -rf "${tmp}" echo "Success! The released NuGet package is available here:" - echo " https://www.nuget.org/packages/Apache.Arrow.Adbc/${version}" -} - -header() { - echo "============================================================" - echo "${1}" - echo "============================================================" + echo " https://www.nuget.org/packages/Apache.Arrow.Adbc/${VERSION_CSHARP}" } main "$@" diff --git a/dev/release/post-09-bump-versions.sh b/dev/release/post-09-bump-versions.sh index 152b34e85b..8eecaa3b60 100755 --- a/dev/release/post-09-bump-versions.sh +++ b/dev/release/post-09-bump-versions.sh @@ -20,39 +20,52 @@ set -ue SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" -if [ "$#" -ne 3 ]; then - echo "Usage: $0 " - echo "Usage: $0 ../arrow 0.1.0 1.0.0" - exit 1 -fi +main() { + if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + echo "Usage: $0 ../arrow" + exit 1 + fi -. $SOURCE_DIR/utils-prepare.sh + local -r arrow_dir="$1" -arrow_dir=$1 -version=$2 -next_version=$3 -next_version_snapshot="${next_version}-SNAPSHOT" + echo "Release: ${RELEASE}" + echo "Previous Release: ${PREVIOUS_RELEASE}" -export ARROW_SOURCE="$(cd "${arrow_dir}" && pwd)" + local -r tag="apache-arrow-adbc-${RELEASE}" + if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then + echo "The tag ${tag} already exists." + echo "Please update ${SOURCE_DIR}/versions.env." + exit 1 + fi -########################## Update Snapshot Version ########################## + read -p "Please confirm that ${SOURCE_DIR}/versions.env has been updated. " -git fetch --all --prune --tags --force -j$(nproc) -git switch main -git rebase apache/main + export ARROW_SOURCE="$(cd "${arrow_dir}" && pwd)" -echo "Updating versions for ${next_version_snapshot}" -update_versions "${version}" "${next_version}" "snapshot" -git commit -m "chore: update versions for ${next_version_snapshot}" -echo "Bumped versions on branch." + ########################## Update Snapshot Version ########################## -############################# Update Changelog ############################## + git fetch --all --prune --tags --force -j$(nproc) + git switch main + git rebase apache/main -git checkout apache-arrow-adbc-${version} -- CHANGELOG.md -git commit -m "chore: update changelog for ${version}" -echo "Updated changelog on branch." + echo "Updating versions for ${RELEASE}-SNAPSHOT" + update_versions "snapshot" + git commit -m "chore: update versions for ${RELEASE}-SNAPSHOT" + echo "Bumped versions on branch." -echo "Review the commits just made." -echo "Then, push changes to apache/arrow-adbc:main with:" -echo git push apache main + ############################# Update Changelog ############################## + + git checkout apache-arrow-adbc-${PREVIOUS_RELEASE} -- CHANGELOG.md + git commit -m "chore: update changelog for ${PREVIOUS_RELEASE}" + echo "Updated changelog on branch." + + echo "Review the commits just made." + echo "Then, push changes to apache/arrow-adbc:main with:" + echo git push apache main +} + +main "$@" diff --git a/dev/release/utils-common.sh b/dev/release/utils-common.sh new file mode 100644 index 0000000000..2cec70b667 --- /dev/null +++ b/dev/release/utils-common.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# 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. + +: ${DRY_RUN:=0} +: ${REPOSITORY:="apache/arrow-adbc"} +: ${WORKFLOW_REF:="main"} + +SOURCE_TOP_DIR="$( cd "${SOURCE_DIR}/../../" && pwd )" + +if [[ ! -f "${SOURCE_DIR}/.env" ]]; then + echo "You must create ${SOURCE_DIR}/.env" + echo "You can use ${SOURCE_DIR}/.env.example as a template" +fi + +source "${SOURCE_DIR}/.env" + +header() { + echo "============================================================" + echo "${1}" + echo "============================================================" +} + +header "Config" + +echo "Repository: ${REPOSITORY}" +echo "Source Directory: ${SOURCE_TOP_DIR}" diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh index 3236ab1da5..467740078e 100644 --- a/dev/release/utils-prepare.sh +++ b/dev/release/utils-prepare.sh @@ -16,32 +16,53 @@ # under the License. ADBC_DIR="${SOURCE_DIR}/../.." +source "${SOURCE_DIR}/versions.env" update_versions() { - local base_version=$1 - local next_version=$2 - local type=$3 + local type=$1 + local conda_version="${VERSION_NATIVE}" + local csharp_version="${VERSION_CSHARP}" + local rust_version="${VERSION_CSHARP}" case ${type} in release) - local version=${base_version} - local conda_version=${base_version} - local docs_version=${base_version} - local py_version=${base_version} - local r_version=${base_version} + local cmake_version="${VERSION_NATIVE}" + local docs_version="${RELEASE}" + local glib_version="${VERSION_NATIVE}" + local java_version="${VERSION_JAVA}" + local linux_version="${VERSION_NATIVE}" + local py_version="${VERSION_NATIVE}" + local r_version="${VERSION_R}" ;; snapshot) - local version=${next_version}-SNAPSHOT - local conda_version=${next_version} - local docs_version="${next_version} (dev)" - local py_version="${next_version}dev" - local r_version="${base_version}.9000" + local cmake_version="${VERSION_NATIVE}-SNAPSHOT" + local docs_version="${RELEASE} (dev)" + local glib_version="${VERSION_NATIVE}-SNAPSHOT" + local java_version="${VERSION_JAVA}-SNAPSHOT" + local linux_version="${VERSION_NATIVE}-SNAPSHOT" + local py_version="${VERSION_NATIVE}dev" + local r_version="${VERSION_R}.9000" + ;; + *) + echo "Unknown type: ${type}" + exit 1 ;; esac - local major_version=${version%%.*} + + header "Updating versions for release ${RELEASE}" + echo "CMake: ${cmake_version}" + echo "Conda: ${conda_version}" + echo "C#: ${csharp_version}" + echo "Docs: ${docs_version}" + echo "GLib/Ruby: ${glib_version}" + echo "Java: ${java_version}" + echo "Linux: ${linux_version}" + echo "Python: ${py_version}" + echo "R: ${r_version}" + echo "Rust: ${rust_version}" pushd "${ADBC_DIR}/c/" - sed -i.bak -E "s/set\(ADBC_VERSION \".+\"\)/set(ADBC_VERSION \"${version}\")/g" cmake_modules/AdbcVersion.cmake + sed -i.bak -E "s/set\(ADBC_VERSION \".+\"\)/set(ADBC_VERSION \"${cmake_version}\")/g" cmake_modules/AdbcVersion.cmake rm cmake_modules/AdbcVersion.cmake.bak git add cmake_modules/AdbcVersion.cmake popd @@ -52,7 +73,7 @@ update_versions() { git add meta.yaml popd - sed -i.bak -E "s|.+|${version}|" "${ADBC_DIR}/csharp/Directory.Build.props" + sed -i.bak -E "s|.+|${csharp_version}|" "${ADBC_DIR}/csharp/Directory.Build.props" rm "${ADBC_DIR}/csharp/Directory.Build.props.bak" git add "${ADBC_DIR}/csharp/Directory.Build.props" @@ -61,14 +82,14 @@ update_versions() { git add "${ADBC_DIR}/docs/source/conf.py" pushd "${ADBC_DIR}/java/" - mvn versions:set "-DnewVersion=${version}" '-DoldVersion=*' + mvn -B versions:set "-DnewVersion=${java_version}" '-DoldVersion=*' find . -type f -name pom.xml.versionsBackup -delete - sed -i.bak -E "s|.+|${version}|g" pom.xml + sed -i.bak -E "s|.+|${java_version}|g" pom.xml rm pom.xml.bak git add "pom.xml" "**/pom.xml" popd - sed -i.bak -E "s/version: '.+'/version: '${version}'/g" "${ADBC_DIR}/glib/meson.build" + sed -i.bak -E "s/version: '.+'/version: '${glib_version}'/g" "${ADBC_DIR}/glib/meson.build" rm "${ADBC_DIR}/glib/meson.build.bak" git add "${ADBC_DIR}/glib/meson.build" @@ -76,7 +97,7 @@ update_versions() { rm "${ADBC_DIR}"/python/adbc_*/adbc_*/_static_version.py.bak git add "${ADBC_DIR}"/python/adbc_*/adbc_*/_static_version.py - sed -i.bak -E "s/VERSION = \".+\"/VERSION = \"${version}\"/g" "${ADBC_DIR}/ruby/lib/adbc/version.rb" + sed -i.bak -E "s/VERSION = \".+\"/VERSION = \"${glib_version}\"/g" "${ADBC_DIR}/ruby/lib/adbc/version.rb" rm "${ADBC_DIR}/ruby/lib/adbc/version.rb.bak" git add "${ADBC_DIR}/ruby/lib/adbc/version.rb" @@ -86,20 +107,20 @@ update_versions() { git add "${desc_file}" done - sed -i.bak -E "s/^version = \".+\"/version = \"${version}\"/" "${ADBC_DIR}/rust/Cargo.toml" + sed -i.bak -E "s/^version = \".+\"/version = \"${rust_version}\"/" "${ADBC_DIR}/rust/Cargo.toml" rm "${ADBC_DIR}/rust/Cargo.toml.bak" git add "${ADBC_DIR}/rust/Cargo.toml" if [ ${type} = "release" ]; then pushd "${ADBC_DIR}/ci/linux-packages" - rake version:update VERSION=${version} + rake version:update VERSION=${linux_version} git add debian*/changelog yum/*.spec.in popd else so_version() { local -r version=$1 - local -r major_version=$(echo $version | sed -E -e 's/^([0-9]+)\.[0-9]+\.[0-9]+$/\1/') - local -r minor_version=$(echo $version | sed -E -e 's/^[0-9]+\.([0-9]+)\.[0-9]+$/\1/') + local -r major_version=$(echo $linux_version | sed -E -e 's/^([0-9]+)\.[0-9]+\.[0-9]+$/\1/') + local -r minor_version=$(echo $linux_version | sed -E -e 's/^[0-9]+\.([0-9]+)\.[0-9]+$/\1/') printf "%0d%02d" ${major_version} ${minor_version} } local -r deb_lib_suffix=$(so_version ${base_version}) diff --git a/dev/release/versions.env b/dev/release/versions.env new file mode 100644 index 0000000000..ccdf793618 --- /dev/null +++ b/dev/release/versions.env @@ -0,0 +1,30 @@ +# 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. + +# The release as a whole has a date-based identifier. This is used to +# identify tags, branches, and so on. +RELEASE="2024.05" +PREVIOUS_RELEASE="0.11.0" + +# Individual components will have a SemVer. +VERSION_CSHARP="0.12.0" +VERSION_JAVA="0.12.0" +# Because C++/Go/Python are effectively tied at the hip, they share a single +# version number. Also covers Conda/Linux packages. +VERSION_NATIVE="1.0.0" +VERSION_R="0.12.0" +VERSION_RUST="0.12.0"