Skip to content

Commit f13ffdf

Browse files
committed
GH-548: [Release][Docs] Publish docs to https://arrow.apache.org/java/current/ on release
Fixes GH-548.
1 parent 92fece1 commit f13ffdf

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

.github/workflows/rc.yml

Lines changed: 3 additions & 4 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
@@ -537,7 +536,7 @@ jobs:
537536
cd site
538537
git config --global user.name 'github-actions[bot]'
539538
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
540-
git commit -m "Publish documentation (${GITHUB_SHA})"
539+
git commit -m "Publish documents (${GITHUB_SHA})"
541540
git push origin "${BRANCH}"
542541
verify:
543542
name: Verify
@@ -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: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,65 @@ 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
49+
- name: Create GitHub Release
50+
run: |
51+
# GH-499: How to create release notes?
52+
version=${GITHUB_REF_NAME#v}
53+
gh release create ${GITHUB_REF_NAME} \
54+
--generate-notes \
55+
--repo ${GITHUB_REPOSITORY} \
56+
--title "Apache Arrow Java ${version}" \
57+
--verify-tag \
58+
dists/*
4659
- name: Create GitHub Release
4760
run: |
4861
# GH-499: How to create release notes?
4962
version=${GITHUB_REF_NAME#v}
5063
gh release create ${GITHUB_REF_NAME} \
5164
--generate-notes \
65+
--repo ${GITHUB_REPOSITORY} \
5266
--title "Apache Arrow Java ${version}" \
5367
--verify-tag \
5468
dists/*
69+
- name: Checkout for publishing documents
70+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
71+
with:
72+
path: site
73+
- name: Publish documents
74+
run: |
75+
set -x
76+
77+
tar -xf dists/html.tar.gz
78+
version=${GITHUB_REF_NAME#v}
79+
80+
if [ "${GITHUB_REPOSITORY}" = "apache/arrow-java" ]; then
81+
BRANCH=asf-site
82+
else
83+
BRANCH=gh-pages
84+
fi
85+
86+
cd site
87+
git fetch
88+
git switch -c "${BRANCH}" "origin/${BRANCH}"
89+
90+
rm -rf current ${version}
91+
cp -a ../html current
92+
cp -a ../html ${version}
93+
git add current ${version}
94+
95+
git config --global user.name 'github-actions[bot]'
96+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
97+
git commit -m "Publish documents (${GITHUB_REF_NAME})"
98+
git push origin "${BRANCH}"

0 commit comments

Comments
 (0)