Skip to content

Commit

Permalink
apacheGH-548: [Release][Docs] Publish docs to https://arrow.apache.or…
Browse files Browse the repository at this point in the history
  • Loading branch information
kou authored Jan 30, 2025
1 parent 730f9c0 commit f6b4f98
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ jobs:
with:
name: release-html
path: html.tar.gz
public-docs:
publish-docs:
name: Publish docs
# Run only when:
# * We push to a branch
Expand All @@ -496,7 +496,6 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: site
persist-credentials: true
- name: Prepare branch
run: |
if [ "${GITHUB_REPOSITORY}" = "apache/arrow-java" ]; then
Expand Down Expand Up @@ -599,7 +598,7 @@ jobs:
gh release create ${GITHUB_REF_NAME} \
--generate-notes \
--prerelease \
--repo ${{ github.repository }} \
--repo ${GITHUB_REPOSITORY} \
--title "Apache Arrow Java ${version} RC${rc}" \
--verify-tag \
artifacts/*/*
Expand Down
46 changes: 40 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,55 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Download RC contents
run: |
set -x
latest_rc_tag=$(gh release list --json tagName --jq '.[].tagName' | \
grep -F "${GITHUB_REF_NAME}-rc" | \
head -n1)
gh release download ${latest_rc_tag} --dir dists
latest_rc_tag=$(gh release list \
--jq '.[].tagName' \
--json tagName \
--repo ${GITHUB_REPOSITORY} | \
grep -F "${GITHUB_REF_NAME}-rc" | \
head -n1)
gh release download ${latest_rc_tag} \
--repo ${GITHUB_REPOSITORY} \
--dir dists
- name: Create GitHub Release
run: |
# GH-499: How to create release notes?
version=${GITHUB_REF_NAME#v}
gh release create ${GITHUB_REF_NAME} \
--generate-notes \
--repo ${GITHUB_REPOSITORY} \
--title "Apache Arrow Java ${version}" \
--verify-tag \
dists/*
- name: Checkout for publishing docs
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: site
- name: Publish docs
run: |
set -x
tar -xf dists/html.tar.gz
version=${GITHUB_REF_NAME#v}
if [ "${GITHUB_REPOSITORY}" = "apache/arrow-java" ]; then
BRANCH=asf-site
else
BRANCH=gh-pages
fi
cd site
git fetch
git switch -c "${BRANCH}" "origin/${BRANCH}"
rm -rf current ${version}
cp -a ../html current
cp -a ../html ${version}
git add current ${version}
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m "Publish documentation (${GITHUB_REF_NAME})"
git push origin "${BRANCH}"
12 changes: 9 additions & 3 deletions dev/release/release_rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then

echo "Looking for GitHub Actions workflow on ${repository}:${rc_tag}"
run_id=""
while [ -z "${run_id}" ]; do
while true; do
echo "Waiting for run to start..."
run_id=$(gh run list \
--branch "${rc_tag}" \
Expand All @@ -106,11 +106,17 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then
--limit 1 \
--repo "${repository}" \
--workflow rc.yml)
sleep 1
if [ -n "${run_id}" ]; then
break
fi
sleep 60
done

echo "Found GitHub Actions workflow with ID: ${run_id}"
gh run watch --repo "${repository}" --exit-status "${run_id}"
gh run watch \
--exit-status "${run_id}" \
--interval 60 \
--repo "${repository}"

echo "Downloading artifacts from GitHub Releases"
gh release download "${rc_tag}" \
Expand Down

0 comments on commit f6b4f98

Please sign in to comment.