diff --git a/docs/processes/release/tasks/versions.md b/docs/processes/release/tasks/versions.md index 17d37e9dd64..b09e35f6486 100644 --- a/docs/processes/release/tasks/versions.md +++ b/docs/processes/release/tasks/versions.md @@ -213,6 +213,7 @@ Edit the root pom file at `icu4j/pom.xml` and manually make this change: 5. Update the following variables in `icu4j/releases_tools/shared.sh` * `artifact_version` - The version used in the Maven `pom.xml` files. You can alternatively produce this value by running `mvn help:evaluate -Dexpression=project.version -q -DforceStdout`. + * `github_rel_version` - The version used in the name of the GitHub downloadable artifacts. For example "73_2" or "74rc". * `api_report_version` - The major version of the new version. Change during RC BRS. * `api_report_prev_version` - The major version of the previous version. Change during RC BRS. diff --git a/icu4j/releases_tools/api_reports.sh b/icu4j/releases_tools/api_reports.sh index a8b9b5d62fd..1d9452aa75b 100755 --- a/icu4j/releases_tools/api_reports.sh +++ b/icu4j/releases_tools/api_reports.sh @@ -8,20 +8,6 @@ if [ ! -f "releases_tools/shared.sh" ]; then fi . releases_tools/shared.sh -function checkThatJdk8IsDefault() { - javac -version appPath 2>&1 | grep -E 'javac 1\.8\.' > /dev/null - if [ $? -eq 0 ]; then - echo "The default JDK version is 8, all good!" - javac -version - else - echo "This step can only be executed with JDK 8!" - echo "Make sure that you have the PATH pointing to a JDK 8!" - javac -version - exit - fi - -} - # ==================================================================================== # The start of the script proper diff --git a/icu4j/releases_tools/github_release.sh b/icu4j/releases_tools/github_release.sh new file mode 100755 index 00000000000..341da03f3ea --- /dev/null +++ b/icu4j/releases_tools/github_release.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# Copyright (C) 2023 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +if [ ! -f "releases_tools/shared.sh" ]; then + echo "ERROR: This script should be executed while being in the icu4j folder" + exit +fi +. releases_tools/shared.sh + +function copyArtifactForGithubRelease() { + local artifactId=$1 + # Copy artifacts in the output folder + mvn dependency:copy -q -Dmdep.stripVersion=true -Dartifact=com.ibm.icu:${artifactId}:${artifact_version} -DoutputDirectory=${release_folder} + mvn dependency:copy -q -Dmdep.stripVersion=true -Dartifact=com.ibm.icu:${artifactId}:${artifact_version}:jar:sources -DoutputDirectory=${release_folder} + # Change the names + mv ${release_folder}/${artifactId}.jar ${release_folder}/${artifactId}-${github_rel_version}.jar + mv ${release_folder}/${artifactId}-sources.jar ${release_folder}/${artifactId}-${github_rel_version}-sources.jar +} + +# ==================================================================================== +# The start of the script proper + +release_folder=${out_dir}/github_release +# We still need JDK 8 to generate the javadoc (because of the doclets) +checkThatJdk8IsDefault + +# ==================================================================================== +# Build artifacts and copy them in the output folder + +reportTitle Prepare folder with artifacts for GitHub release + +mvn clean install -DskipITs -DskipTests -P with_sources + +rm -fr ${release_folder} +mkdir -p ${release_folder} +copyArtifactForGithubRelease icu4j +copyArtifactForGithubRelease icu4j-charset +copyArtifactForGithubRelease icu4j-localespi + +# ==================================================================================== +# Build complete javadoc and copy it in the output folder + +reportTitle Prepare complete javadoc for GitHub release + +mvn site -DskipITs -DskipTests -P with_full_javadoc + +jar -Mcf ${release_folder}/icu4j-${github_rel_version}-javadoc.jar -C ${out_dir}/site/apidocs/ . + +# ==================================================================================== + +pushd ${release_folder} +md5sum *.jar > icu4j-${github_rel_version}.md5 +popd + +reportTitle "You can find the results in ${release_folder}/" diff --git a/icu4j/releases_tools/shared.sh b/icu4j/releases_tools/shared.sh index b741c97f5b1..dc45b2ffb1f 100755 --- a/icu4j/releases_tools/shared.sh +++ b/icu4j/releases_tools/shared.sh @@ -6,6 +6,7 @@ export MAVEN_ARGS='--no-transfer-progress' # Version update! export artifact_version='74.1-SNAPSHOT' +export github_rel_version='74rc' export api_report_version='74' export api_report_prev_version='73' export out_dir=target