From e530a0956dc7342f0ed071b087263a7639bf12ab Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 7 Mar 2025 17:06:28 -0800 Subject: [PATCH 1/2] Add yaml examples generation to the release scripts. --- .github/workflows/build_release_candidate.yml | 1 + release/src/main/scripts/build_release_candidate.sh | 2 ++ sdks/python/build.gradle | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_release_candidate.yml b/.github/workflows/build_release_candidate.yml index 461b2165d074..0fcd28742b5b 100644 --- a/.github/workflows/build_release_candidate.yml +++ b/.github/workflows/build_release_candidate.yml @@ -391,6 +391,7 @@ jobs: echo "............Copying generated yamldoc into beam-site.........." mkdir -p yamldoc/${{ github.event.inputs.RELEASE }} cp -r ${BEAM_ROOT_DIR}/sdks/python/build/yaml-ref.html yamldoc/${{ github.event.inputs.RELEASE }}/index.html + cp -r ${BEAM_ROOT_DIR}/sdks/python/build/yaml-eamples.html yamldoc/${{ github.event.inputs.RELEASE }}/examples.html # Update current symlink to point to the latest release unlink yamldoc/current | true ln -s ${{ github.event.inputs.RELEASE }} yamldoc/current diff --git a/release/src/main/scripts/build_release_candidate.sh b/release/src/main/scripts/build_release_candidate.sh index 8d37b53d3729..a88022effb2c 100755 --- a/release/src/main/scripts/build_release_candidate.sh +++ b/release/src/main/scripts/build_release_candidate.sh @@ -372,6 +372,7 @@ if [[ $confirmation = "y" ]]; then cd ${BEAM_ROOT_DIR} ./gradlew :sdks:python:generateYamlDocs -PisRelease GENERATE_YAMLDOC=~/${LOCAL_WEBSITE_UPDATE_DIR}/${LOCAL_YAML_DOC}/${BEAM_ROOT_DIR}/sdks/python/build/yaml-ref.html + GENERATE_YAMLDOC_EXAMPLES=~/${LOCAL_WEBSITE_UPDATE_DIR}/${LOCAL_YAML_DOC}/${BEAM_ROOT_DIR}/sdks/python/build/yaml-examples.html echo "------------------Updating Release Docs---------------------" cd ~/${LOCAL_WEBSITE_UPDATE_DIR}/${LOCAL_WEBSITE_REPO} @@ -402,6 +403,7 @@ if [[ $confirmation = "y" ]]; then echo "............Copying generated yaml docs into beam-site.........." mkdir -p yamldoc cp -r ${GENERATE_YAMLDOC} yamldoc/${RELEASE}/index.html + cp -r ${GENERATE_YAMLDOC_EXAMPLES} yamldoc/${RELEASE}/examples.html # Update current symlink to point to the latest release unlink yamldoc/current | true ln -s ${RELEASE} yamldoc/current diff --git a/sdks/python/build.gradle b/sdks/python/build.gradle index 832f567c66fd..161f88af8540 100644 --- a/sdks/python/build.gradle +++ b/sdks/python/build.gradle @@ -101,10 +101,11 @@ tasks.register("generateYamlDocs") { exec { executable 'sh' args '-c', "${envdir}/bin/pip install $extraPackages && " + - "${envdir}/bin/python -m apache_beam.yaml.generate_yaml_docs --html_file=${buildDir}/yaml-ref.html" + "${envdir}/bin/python -m apache_beam.yaml.generate_yaml_docs --html_file=${buildDir}/yaml-ref.html --examples_file=${buildDir}/yaml-examples" } } outputs.file "${buildDir}/yaml-ref.html" + outputs.file "${buildDir}/yaml-examples.html" } tasks.register("yamlIntegrationTests") { From 4f930e6bf1bc1bbe6510a3913790d2f38a033f3c Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Mon, 10 Mar 2025 16:48:19 -0700 Subject: [PATCH 2/2] Update .github/workflows/build_release_candidate.yml Co-authored-by: Danny McCormick --- .github/workflows/build_release_candidate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_release_candidate.yml b/.github/workflows/build_release_candidate.yml index 0fcd28742b5b..3a31820ae646 100644 --- a/.github/workflows/build_release_candidate.yml +++ b/.github/workflows/build_release_candidate.yml @@ -391,7 +391,7 @@ jobs: echo "............Copying generated yamldoc into beam-site.........." mkdir -p yamldoc/${{ github.event.inputs.RELEASE }} cp -r ${BEAM_ROOT_DIR}/sdks/python/build/yaml-ref.html yamldoc/${{ github.event.inputs.RELEASE }}/index.html - cp -r ${BEAM_ROOT_DIR}/sdks/python/build/yaml-eamples.html yamldoc/${{ github.event.inputs.RELEASE }}/examples.html + cp -r ${BEAM_ROOT_DIR}/sdks/python/build/yaml-examples.html yamldoc/${{ github.event.inputs.RELEASE }}/examples.html # Update current symlink to point to the latest release unlink yamldoc/current | true ln -s ${{ github.event.inputs.RELEASE }} yamldoc/current