diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 8e7f7f5fb..9717f30a9 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 @@ -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..e801fd049 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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}" diff --git a/dev/release/release_rc.sh b/dev/release/release_rc.sh index dd61f9c9e..137537646 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}" \