From f13ffdfe57648a3b7f4b09210c70ff5af69d7b09 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 28 Jan 2025 10:47:08 +0900 Subject: [PATCH 1/4] GH-548: [Release][Docs] Publish docs to https://arrow.apache.org/java/current/ on release Fixes GH-548. --- .github/workflows/rc.yml | 7 ++--- .github/workflows/release.yml | 56 +++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 8e7f7f5fb..cafcb8e84 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -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 @@ -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 @@ -537,7 +536,7 @@ jobs: cd site 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_SHA})" + git commit -m "Publish documents (${GITHUB_SHA})" git push origin "${BRANCH}" verify: name: Verify @@ -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/*/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4982c6b34..ee2c58851 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,21 +34,65 @@ 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: 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 documents + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: site + - name: Publish documents + 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 documents (${GITHUB_REF_NAME})" + git push origin "${BRANCH}" From 861ca83288156760b1c0bba64ed1244361622e28 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 28 Jan 2025 11:54:05 +0900 Subject: [PATCH 2/4] Use docs or documentation --- .github/workflows/rc.yml | 2 +- .github/workflows/release.yml | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index cafcb8e84..9717f30a9 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -536,7 +536,7 @@ jobs: cd site git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git commit -m "Publish documents (${GITHUB_SHA})" + git commit -m "Publish documentation (${GITHUB_SHA})" git push origin "${BRANCH}" verify: name: Verify diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee2c58851..e801fd049 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,21 +56,11 @@ jobs: --title "Apache Arrow Java ${version}" \ --verify-tag \ 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 documents + - name: Checkout for publishing docs uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: site - - name: Publish documents + - name: Publish docs run: | set -x @@ -94,5 +84,5 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git commit -m "Publish documents (${GITHUB_REF_NAME})" + git commit -m "Publish documentation (${GITHUB_REF_NAME})" git push origin "${BRANCH}" From 1023f83c0e49928caa3ed7e09d9a7f926d0d6a95 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 28 Jan 2025 11:54:34 +0900 Subject: [PATCH 3/4] Use more interval --- dev/release/release_rc.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dev/release/release_rc.sh b/dev/release/release_rc.sh index dd61f9c9e..c4ad189ce 100755 --- a/dev/release/release_rc.sh +++ b/dev/release/release_rc.sh @@ -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}" \ @@ -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}" \ From 70d8565e78b798f759f7b46d3ad4b256c497aeb6 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 28 Jan 2025 11:58:43 +0900 Subject: [PATCH 4/4] Fix style --- dev/release/release_rc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/release/release_rc.sh b/dev/release/release_rc.sh index c4ad189ce..137537646 100755 --- a/dev/release/release_rc.sh +++ b/dev/release/release_rc.sh @@ -114,9 +114,9 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then echo "Found GitHub Actions workflow with ID: ${run_id}" gh run watch \ - --exit-status "${run_id}" \ - --interval 60 \ - --repo "${repository}" + --exit-status "${run_id}" \ + --interval 60 \ + --repo "${repository}" echo "Downloading artifacts from GitHub Releases" gh release download "${rc_tag}" \