diff --git a/dev/release/01-prepare.sh b/dev/release/01-prepare.sh index 7dab7968e0..99b3f20ecb 100755 --- a/dev/release/01-prepare.sh +++ b/dev/release/01-prepare.sh @@ -19,26 +19,22 @@ # set -ue -SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ "$#" -ne 5 ]; then - echo "Usage: $0 " - echo "Usage: $0 ../arrow 0.1.0 0.2.0 0.3.0 0" +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + echo "Usage: $0 ../arrow 0" exit 1 fi -. $SOURCE_DIR/utils-prepare.sh +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source $SOURCE_DIR/utils-prepare.sh arrow_dir=$1 -prev_version=$2 -version=$3 -next_version=$4 -next_version_snapshot="${next_version}-SNAPSHOT" -rc_number=$5 +rc_number=$2 export ARROW_SOURCE="$(cd "${arrow_dir}" && pwd)" -release_candidate_tag="apache-arrow-adbc-${version}-rc${rc_number}" +release_candidate_tag="apache-arrow-adbc-${RELEASE}-rc${rc_number}" if [[ $(git tag -l "${release_candidate_tag}") ]]; then next_rc_number=$(($rc_number+1)) @@ -47,33 +43,33 @@ if [[ $(git tag -l "${release_candidate_tag}") ]]; then 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}" + echo " dev/release/01-prepare.sh ${arrow_dir} ${next_rc_number}" exit 1 fi ############################## Pre-Tag Commits ############################## -echo "Updating changelog for $version" +echo "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 ${version}" --start-rev apache-arrow-adbc-${prev_version})" + 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 $version" +git commit -m "chore: update CHANGELOG.md for ${RELEASE}" -echo "Prepare release ${version} on tag ${release_candidate_tag}" +echo "Prepare release ${RELEASE} on tag ${release_candidate_tag}" -update_versions "${version}" "${next_version}" "release" +update_versions "release" # --allow-empty required for RCs after the first -git commit -m "chore: update versions for ${version}" --allow-empty +git commit -m "chore: update versions for ${RELEASE}" --allow-empty ######################### Tag the Release Candidate ######################### -git tag -a "${release_candidate_tag}" -m "ADBC Libraries ${version} RC ${rc_number}" +git tag -a "${release_candidate_tag}" -m "ADBC Libraries ${RELEASE} RC ${rc_number}" echo "Created release candidate tag: ${release_candidate_tag}" echo "Push this tag before continuing!" diff --git a/dev/release/utils-common.sh b/dev/release/utils-common.sh new file mode 100644 index 0000000000..109be04aef --- /dev/null +++ b/dev/release/utils-common.sh @@ -0,0 +1,23 @@ +#!/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. + +header() { + echo "============================================================" + echo "${1}" + echo "============================================================" +} diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh index 3236ab1da5..286c055672 100644 --- a/dev/release/utils-prepare.sh +++ b/dev/release/utils-prepare.sh @@ -16,32 +16,54 @@ # under the License. ADBC_DIR="${SOURCE_DIR}/../.." +source "${SOURCE_DIR}/utils-common.sh" +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_GLIB}" + 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_GLIB}-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 +74,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 +83,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 +98,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 +108,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..95c853dd73 --- /dev/null +++ b/dev/release/versions.env @@ -0,0 +1,32 @@ +# 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_GLIB="1.0.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. +# TODO: untie this so that we can have independent version #s for different drivers (at least for Postgres/SQLite) +VERSION_NATIVE="1.0.0" +VERSION_R="0.12.0" +VERSION_RUST="0.12.0" \ No newline at end of file