Skip to content

Commit f6b4f98

Browse files
authored
GH-548: [Release][Docs] Publish docs to https://arrow.apache.org/java/current/ on release (#569)
Fixes GH-548.
1 parent 730f9c0 commit f6b4f98

File tree

3 files changed

+51
-12
lines changed

3 files changed

+51
-12
lines changed

.github/workflows/rc.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ jobs:
471471
with:
472472
name: release-html
473473
path: html.tar.gz
474-
public-docs:
474+
publish-docs:
475475
name: Publish docs
476476
# Run only when:
477477
# * We push to a branch
@@ -496,7 +496,6 @@ jobs:
496496
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
497497
with:
498498
path: site
499-
persist-credentials: true
500499
- name: Prepare branch
501500
run: |
502501
if [ "${GITHUB_REPOSITORY}" = "apache/arrow-java" ]; then
@@ -599,7 +598,7 @@ jobs:
599598
gh release create ${GITHUB_REF_NAME} \
600599
--generate-notes \
601600
--prerelease \
602-
--repo ${{ github.repository }} \
601+
--repo ${GITHUB_REPOSITORY} \
603602
--title "Apache Arrow Java ${version} RC${rc}" \
604603
--verify-tag \
605604
artifacts/*/*

.github/workflows/release.yml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,55 @@ jobs:
3434
runs-on: ubuntu-latest
3535
timeout-minutes: 5
3636
steps:
37-
- name: Checkout
38-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3937
- name: Download RC contents
4038
run: |
4139
set -x
42-
latest_rc_tag=$(gh release list --json tagName --jq '.[].tagName' | \
43-
grep -F "${GITHUB_REF_NAME}-rc" | \
44-
head -n1)
45-
gh release download ${latest_rc_tag} --dir dists
40+
latest_rc_tag=$(gh release list \
41+
--jq '.[].tagName' \
42+
--json tagName \
43+
--repo ${GITHUB_REPOSITORY} | \
44+
grep -F "${GITHUB_REF_NAME}-rc" | \
45+
head -n1)
46+
gh release download ${latest_rc_tag} \
47+
--repo ${GITHUB_REPOSITORY} \
48+
--dir dists
4649
- name: Create GitHub Release
4750
run: |
4851
# GH-499: How to create release notes?
4952
version=${GITHUB_REF_NAME#v}
5053
gh release create ${GITHUB_REF_NAME} \
5154
--generate-notes \
55+
--repo ${GITHUB_REPOSITORY} \
5256
--title "Apache Arrow Java ${version}" \
5357
--verify-tag \
5458
dists/*
59+
- name: Checkout for publishing docs
60+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
61+
with:
62+
path: site
63+
- name: Publish docs
64+
run: |
65+
set -x
66+
67+
tar -xf dists/html.tar.gz
68+
version=${GITHUB_REF_NAME#v}
69+
70+
if [ "${GITHUB_REPOSITORY}" = "apache/arrow-java" ]; then
71+
BRANCH=asf-site
72+
else
73+
BRANCH=gh-pages
74+
fi
75+
76+
cd site
77+
git fetch
78+
git switch -c "${BRANCH}" "origin/${BRANCH}"
79+
80+
rm -rf current ${version}
81+
cp -a ../html current
82+
cp -a ../html ${version}
83+
git add current ${version}
84+
85+
git config --global user.name 'github-actions[bot]'
86+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
87+
git commit -m "Publish documentation (${GITHUB_REF_NAME})"
88+
git push origin "${BRANCH}"

dev/release/release_rc.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then
9797

9898
echo "Looking for GitHub Actions workflow on ${repository}:${rc_tag}"
9999
run_id=""
100-
while [ -z "${run_id}" ]; do
100+
while true; do
101101
echo "Waiting for run to start..."
102102
run_id=$(gh run list \
103103
--branch "${rc_tag}" \
@@ -106,11 +106,17 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then
106106
--limit 1 \
107107
--repo "${repository}" \
108108
--workflow rc.yml)
109-
sleep 1
109+
if [ -n "${run_id}" ]; then
110+
break
111+
fi
112+
sleep 60
110113
done
111114

112115
echo "Found GitHub Actions workflow with ID: ${run_id}"
113-
gh run watch --repo "${repository}" --exit-status "${run_id}"
116+
gh run watch \
117+
--exit-status "${run_id}" \
118+
--interval 60 \
119+
--repo "${repository}"
114120

115121
echo "Downloading artifacts from GitHub Releases"
116122
gh release download "${rc_tag}" \

0 commit comments

Comments
 (0)