Skip to content

Commit ca311c1

Browse files
authored
GH-45961: [Release][Docs] Upload generated docs to GitHub Releases not apache.jfrog.io (#45963)
### Rationale for this change We want to stop using apache.jfrog.io. See also: #40760 ### What changes are included in this PR? Upload generated docs to GitHub Release instead of apache.jfrog.io. Our generated docs are only for publishing. We publish them to https://arrow.apache.org/docs/ . So we don't need any migration path for users. ### Are these changes tested? No. I want to try this in the next release. ### Are there any user-facing changes? No. * GitHub Issue: #45961 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Jacob Wujciak-Jens <[email protected]>
1 parent 4d625b3 commit ca311c1

File tree

5 files changed

+53
-52
lines changed

5 files changed

+53
-52
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ repos:
198198
?^dev/release/05-binary-upload\.sh$|
199199
?^dev/release/07-binary-verify\.sh$|
200200
?^dev/release/post-03-binary\.sh$|
201+
?^dev/release/post-10-docs\.sh$|
201202
?^dev/release/post-11-python\.sh$|
202203
?^dev/release/utils-generate-checksum\.sh$|
203204
)
@@ -214,6 +215,7 @@ repos:
214215
(
215216
?^dev/release/05-binary-upload\.sh$|
216217
?^dev/release/post-03-binary\.sh$|
218+
?^dev/release/post-10-docs\.sh$|
217219
?^dev/release/post-11-python\.sh$|
218220
)
219221
- repo: https://github.com/trim21/pre-commit-mirror-meson

dev/release/05-binary-upload.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ tmp_dir=binary/tmp
8282
rm -rf "${tmp_dir}"
8383
mkdir -p "${tmp_dir}"
8484

85-
if [ "${UPLOAD_PYTHON}" -gt 0 ]; then
86-
dist_dir="${tmp_dir}/dist"
85+
upload_to_github_release() {
86+
local id="$1"
87+
shift
88+
local dist_dir="${tmp_dir}/${id}"
8789
mkdir -p "${dist_dir}"
88-
for target in "${ARROW_ARTIFACTS_DIR}"/python-sdist/* \
89-
"${ARROW_ARTIFACTS_DIR}"/wheel-*/*; do
90+
while [ $# -gt 0 ]; do
91+
local target="$1"
92+
shift
93+
local base_name
9094
base_name="$(basename "${target}")"
9195
cp -a "${target}" "${dist_dir}/${base_name}"
9296
gpg \
@@ -103,6 +107,14 @@ if [ "${UPLOAD_PYTHON}" -gt 0 ]; then
103107
--repo apache/arrow \
104108
"apache-arrow-${version}-rc${rc}" \
105109
"${dist_dir}"/*
110+
}
111+
112+
if [ "${UPLOAD_DOCS}" -gt 0 ]; then
113+
upload_to_github_release docs "${ARROW_ARTIFACTS_DIR}"/*-docs/*
114+
fi
115+
if [ "${UPLOAD_PYTHON}" -gt 0 ]; then
116+
upload_to_github_release python \
117+
"${ARROW_ARTIFACTS_DIR}"/{python-sdist,wheel-*}/*
106118
fi
107119

108120
rake_tasks=()

dev/release/binary-task.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,6 @@ def release
11231123
def define
11241124
define_apt_tasks
11251125
define_yum_tasks
1126-
define_docs_tasks
11271126
define_r_tasks
11281127
define_summary_tasks
11291128
end
@@ -2518,14 +2517,6 @@ def define_generic_data_tasks(label,
25182517
define_generic_data_release_tasks(label, id, release_dir)
25192518
end
25202519

2521-
def define_docs_tasks
2522-
define_generic_data_tasks("Docs",
2523-
:docs,
2524-
"#{rc_dir}/docs/#{full_version}",
2525-
"#{release_dir}/docs/#{full_version}",
2526-
"test-debian-12-docs/**/*")
2527-
end
2528-
25292520
def define_r_rc_tasks(label, id, rc_dir)
25302521
directory rc_dir
25312522

dev/release/post-03-binary.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ fi
5050
: "${DEPLOY_AMAZON_LINUX:=${DEPLOY_DEFAULT}}"
5151
: "${DEPLOY_CENTOS:=${DEPLOY_DEFAULT}}"
5252
: "${DEPLOY_DEBIAN:=${DEPLOY_DEFAULT}}"
53-
: "${DEPLOY_DOCS:=${DEPLOY_DEFAULT}}"
5453
: "${DEPLOY_R:=${DEPLOY_DEFAULT}}"
5554
: "${DEPLOY_UBUNTU:=${DEPLOY_DEFAULT}}"
5655

@@ -73,9 +72,6 @@ if [ "${DEPLOY_DEBIAN}" -gt 0 ]; then
7372
rake_tasks+=(apt:artifactory:release)
7473
apt_targets+=(debian)
7574
fi
76-
if [ "${DEPLOY_DOCS}" -gt 0 ]; then
77-
rake_tasks+=(docs:release)
78-
fi
7975
if [ "${DEPLOY_R}" -gt 0 ]; then
8076
rake_tasks+=(r:release)
8177
fi

dev/release/post-10-docs.sh

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ set -u
2222

2323
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2424
ARROW_DIR="${SOURCE_DIR}/../.."
25-
: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
25+
: "${ARROW_SITE_DIR:=${ARROW_DIR}/../arrow-site}"
2626

27-
if [ "$#" -ne 2 ]; then
27+
if [ "$#" -ne 2 ]; then
2828
echo "Usage: $0 <version> <previous_version>"
2929
exit 1
3030
fi
@@ -35,35 +35,35 @@ release_tag="apache-arrow-${version}"
3535
branch_name=release-docs-${version}
3636

3737
case "${version}" in
38-
*.0.0)
39-
is_major_release=yes
40-
;;
41-
*)
42-
is_major_release=no
43-
;;
38+
*.0.0)
39+
is_major_release=yes
40+
;;
41+
*)
42+
is_major_release=no
43+
;;
4444
esac
4545

4646
pushd "${ARROW_SITE_DIR}"
4747
source "${SOURCE_DIR}/git-vars.sh"
48-
git fetch --all --prune --tags --force -j$(nproc)
48+
git fetch --all --prune --tags --force
4949
git checkout .
50-
git checkout ${DEFAULT_BRANCH}
50+
git checkout "${DEFAULT_BRANCH}"
5151
git clean -d -f -x
5252
git branch -D asf-site || :
5353
git checkout -b asf-site origin/asf-site
5454
git rebase apache/asf-site
55-
git branch -D ${branch_name} || :
56-
git checkout -b ${branch_name}
55+
git branch -D "${branch_name}" || :
56+
git checkout -b "${branch_name}"
5757
# list and remove previous versioned docs
5858
versioned_paths=()
5959
for versioned_path in docs/*.*/; do
60-
versioned_paths+=(${versioned_path})
61-
rm -rf ${versioned_path}
60+
versioned_paths+=("${versioned_path}")
61+
rm -rf "${versioned_path}"
6262
done
6363
# add to list and remove dev docs
6464
versioned_paths+=("docs/dev/")
6565
rm -rf docs/dev/
66-
if [ "$is_major_release" = "yes" ] ; then
66+
if [ "$is_major_release" = "yes" ]; then
6767
cp -r docs/ docs_temp/
6868
fi
6969
# delete current stable docs and restore all previous versioned docs
@@ -77,55 +77,55 @@ curl \
7777
--fail \
7878
--location \
7979
--remote-name \
80-
https://apache.jfrog.io/artifactory/arrow/docs/${version}/docs.tar.gz
80+
"https://github.com/apache/arrow/releases/download/${release_tag}/docs.tar.gz"
8181
tar xvf docs.tar.gz
8282
# Update DOCUMENTATION_OPTIONS.show_version_warning_banner
8383
find docs \
8484
-type f \
8585
-exec \
86-
sed -i.bak \
87-
-e "s/DOCUMENTATION_OPTIONS.show_version_warning_banner = true/DOCUMENTATION_OPTIONS.show_version_warning_banner = false/g" \
88-
{} \;
86+
sed -i.bak \
87+
-e "s/DOCUMENTATION_OPTIONS.show_version_warning_banner = true/DOCUMENTATION_OPTIONS.show_version_warning_banner = false/g" \
88+
{} \;
8989
find ./ -name '*.bak' -delete
9090
popd
9191
mv docs_new/docs/* docs/
9292
rm -rf docs_new
9393

94-
if [ "$is_major_release" = "yes" ] ; then
94+
if [ "$is_major_release" = "yes" ]; then
9595
previous_series=${previous_version%.*}
96-
mv docs_temp docs/${previous_series}
96+
mv docs_temp "docs/${previous_series}"
9797
fi
9898
git add docs
9999
git commit -m "[Website] Update documentations for ${version}"
100100

101101
# Update DOCUMENTATION_OPTIONS.theme_switcher_version_match and
102102
# DOCUMENTATION_OPTIONS.show_version_warning_banner
103-
if [ "$is_major_release" = "yes" ] ; then
104-
pushd docs/${previous_series}
103+
if [ "$is_major_release" = "yes" ]; then
104+
pushd "docs/${previous_series}"
105105
find ./ \
106106
-type f \
107107
-exec \
108-
sed -i.bak \
109-
-e "s/DOCUMENTATION_OPTIONS.theme_switcher_version_match = '';/DOCUMENTATION_OPTIONS.theme_switcher_version_match = '${previous_series}';/g" \
110-
-e "s/DOCUMENTATION_OPTIONS.show_version_warning_banner = false/DOCUMENTATION_OPTIONS.show_version_warning_banner = true/g" \
111-
{} \;
108+
sed -i.bak \
109+
-e "s/DOCUMENTATION_OPTIONS.theme_switcher_version_match = '';/DOCUMENTATION_OPTIONS.theme_switcher_version_match = '${previous_series}';/g" \
110+
-e "s/DOCUMENTATION_OPTIONS.show_version_warning_banner = false/DOCUMENTATION_OPTIONS.show_version_warning_banner = true/g" \
111+
{} \;
112112
find ./ -name '*.bak' -delete
113113
popd
114-
git add docs/${previous_series}
114+
git add "docs/${previous_series}"
115115
git commit -m "[Website] Update warning banner for ${previous_series}"
116116
git clean -d -f -x
117117
popd
118118
fi
119119

120-
: ${PUSH:=1}
120+
: "${PUSH:=1}"
121121

122-
if [ ${PUSH} -gt 0 ]; then
122+
if [ "${PUSH}" -gt 0 ]; then
123123
pushd "${ARROW_SITE_DIR}"
124-
git push -u origin ${branch_name}
125-
github_url=$(git remote get-url origin | \
126-
sed \
127-
-e 's,^[email protected]:,https://github.com/,' \
128-
-e 's,\.git$,,')
124+
git push -u origin "${branch_name}"
125+
github_url=$(git remote get-url origin |
126+
sed \
127+
-e 's,^[email protected]:,https://github.com/,' \
128+
-e 's,\.git$,,')
129129
popd
130130

131131
echo "Success!"

0 commit comments

Comments
 (0)