damccorm commented on code in PR #24720: URL: https://github.com/apache/beam/pull/24720#discussion_r1055795446
########## .github/workflows/build_release_candidate_publish_docs.yml: ########## @@ -0,0 +1,125 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This workflow will choose a commit to be the basis of a release candidate +## and push a new tagged commit for that RC. + +# To learn more about GitHub Actions in Apache Beam check the CI.md + +name: Build Release Candidate Publish Docs +on: + workflow_dispatch: + inputs: + RELEASE: + description: Version Release (e.g. 2.XX.X) + required: true + RC_NO: + description: Release Candidate Number (e.g. 1, 2, 3...) + required: true + +jobs: + update_beam_site: + runs-on: [self-hosted, ubuntu-20.04] + env: + PYTHON_DOC: python_doc + JAVA_DOC: java_doc + WEBSITE_REPO: beam_website_repo + WEBSITE_UPDATE_DIR: website_update_dir + BEAM_WEBSITE_REPO: https://github.com/apache/beam-site + WEBSITE_ROOT_DIR: beam-site + steps: + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Env + run: | + cd ~ + mkdir -p ${{ env.WEBSITE_UPDATE_DIR }} + cd ${{ env.WEBSITE_UPDATE_DIR }} + mkdir -p ${{ env.PYTHON_DOC }} + mkdir -p ${{ env.JAVA_DOC }} + mkdir -p ${{ env.WEBSITE_REPO }} + cd $GITHUB_WORKSPACE + RELEASE_COMMIT="$(git rev-list --tags 'v${{github.event.inputs.RELEASE}}-RC${{github.event.inputs.RC_NO}}' --max-count=1)" + echo "RELEASE_COMMIT=${RELEASE_COMMIT}" >> $GITHUB_ENV + - name: Set Java Version + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 8 + - name: Remove default github maven configuration + # This step is a workaround to avoid a decryption issue of Beam's + # gradle-command-action plugin and github's provided maven + # settings.xml file + shell: bash + run: rm ~/.m2/settings.xml + - name: Build Python Doc + run: | + cd $GITHUB_WORKSPACE + ./gradlew :pythonDocsPreCommit + GENERATED_PYDOC=$GITHUB_WORKSPACE/sdks/python/test-suites/tox/pycommon/build/srcs/sdks/python/target/docs/_build + echo "GENERATED_PYDOC=${GENERATED_PYDOC}" >> $GITHUB_ENV + rm -rf $GENERATED_PYDOC/.doctrees + - name: Build Java Doc + run: | + cd $GITHUB_WORKSPACE + ./gradlew :sdks:java:javadoc:aggregateJavadoc + GENERATED_JAVADOC=$GITHUB_WORKSPACE/sdks/java/javadoc/build/docs/javadoc/ + echo "GENERATED_JAVADOC=${GENERATED_JAVADOC}" >> $GITHUB_ENV + - name: Update Release Docs + run: | + cd ~/${{ env.WEBSITE_UPDATE_DIR }}/${{ env.WEBSITE_REPO }} + rm -rf ${{ env.WEBSITE_ROOT_DIR }} + git clone ${{ env.BEAM_WEBSITE_REPO }}.git + cd ${{ env.WEBSITE_ROOT_DIR }} + git checkout release-docs + git checkout -b updates_release_${{ github.event.inputs.RELEASE }} release-docs + - name: Copy Java Doc and Python into beam-site + run: | + cd ~/${{ env.WEBSITE_UPDATE_DIR }}/${{ env.WEBSITE_REPO }}/${{ env.WEBSITE_ROOT_DIR }} + ls + cp -r ${{env.GENERATED_JAVADOC}} javadoc/${{ github.event.inputs.RELEASE }} + cp -r ${{env.GENERATED_PYDOC}} pydoc/${{ github.event.inputs.RELEASE }} + - name: Push changes to beam-site repository + env: + SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} Review Comment: @kennknowles if we go this route we'll need you (or someone else, but probably makes sense for publishes to be in your name) to upload a private key - the alternative is to have everyone do it locally. IMO having a well defined process to produce the release artifact is worth this weirdness (and is more secure), but I'm open to disagreement -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
