@@ -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