build_release_candidate #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build_release_candidate | |
# Workflow added after https://github.com/apache/beam/commit/4183e747becebd18becee5fff547af365910fc9c | |
# If help is needed debugging issues, you can view the release guide at that commit for guidance on how to do this manually. | |
# (https://github.com/apache/beam/blob/4183e747becebd18becee5fff547af365910fc9c/website/www/site/content/en/contribute/release-guide.md) | |
on: | |
workflow_dispatch: | |
inputs: | |
RELEASE: | |
description: Beam version of current release (e.g. 2.XX.0) | |
required: true | |
default: '2.XX.0' | |
RC: | |
description: Integer RC version for the release (e.g. 3 for RC3) | |
required: true | |
APACHE_ID: | |
description: Your Apache id. Required if you want to stage artifacts into https://dist.apache.org/repos/dist/dev/beam/ | |
required: false | |
APACHE_PASSWORD: | |
description: Your Apache password. Required if you want to stage artifacts into https://dist.apache.org/repos/dist/dev/beam/ | |
required: false | |
REPO_TOKEN: | |
description: | | |
Github Personal Access Token with repo permissions if you want to create the beam-site docs PR, | |
create a draft release, or upload prism artifacts to that release. | |
See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens. | |
default: '' | |
STAGE: | |
description: | | |
Configure which actions this workflow should perform, by setting the desired fields to "yes". | |
-- | |
java_artifacts: publish java artifacts to https://repository.apache.org/#stagingRepositories | |
-- | |
java_source: java source into https://dist.apache.org/repos/dist/dev/beam/ | |
-- | |
docker_artifacts: stage SDK docker images to docker hub Apache organization | |
-- | |
python_artifacts: stage the python artifacts into https://dist.apache.org/repos/dist/dev/beam/ | |
-- | |
beam_site_pr: create the documentation update PR against apache/beam-site. | |
-- | |
prism: build and upload the artifacts to the release for this tag | |
required: true | |
default: | | |
{java_artifacts: "no", | |
java_source: "no", | |
docker_artifacts: "no", | |
python_artifacts: "no", | |
beam_site_pr: "no", | |
prism: "no"} | |
env: | |
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
jobs: | |
beam_site_pr: | |
if: ${{ fromJson(github.event.inputs.STAGE).beam_site_pr == 'yes'}} | |
# Note: if this ever changes to self-hosted, remove the "Remove default github maven configuration" step | |
runs-on: ubuntu-22.04 | |
env: | |
RC_TAG: "v${{ github.event.inputs.RELEASE }}-RC${{ github.event.inputs.RC }}" | |
BRANCH_NAME: updates_release_${{ github.event.inputs.RELEASE }} | |
BEAM_ROOT_DIR: ${{ github.workspace }}/beam | |
SITE_ROOT_DIR: ${{ github.workspace }}/beam-site | |
steps: | |
- name: Checkout Beam Repo | |
uses: actions/checkout@v4 | |
with: | |
ref: "v${{ github.event.inputs.RELEASE }}-RC${{ github.event.inputs.RC }}" | |
repository: apache/beam | |
path: beam | |
- name: Checkout Beam Site Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: apache/beam-site | |
path: beam-site | |
# token: ${{ github.event.inputs.REPO_TOKEN }} | |
ref: release-docs | |
- name: Install Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
# TODO(https://github.com/apache/beam/issues/32726) switch to Java11 | |
- name: Install Java 8 | |
uses: actions/setup-java@v4 | |
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 | |
# net.linguica.gradle.maven.settings plugin and github's provided maven | |
# settings.xml file | |
run: rm ~/.m2/settings.xml || true | |
- name: Create documentation commit for website | |
run: | | |
echo "OK!" | |
# - name: Build Python Docs | |
# working-directory: beam/sdks/python | |
# run: | | |
# pip install --upgrade pip setuptools wheel | |
# pip install -U pip | |
# pip install tox | |
# # TODO(https://github.com/apache/beam/issues/20209): Don't hardcode py version in this file. | |
# tox -e docs | |
# rm -rf target/docs/_build/.doctrees | |
# - name: Build Typescript Docs | |
# working-directory: beam/sdks/typescript | |
# run: | | |
# npm ci && npm run docs | |
# - name: Build Java Docs | |
# working-directory: beam | |
# run: | | |
# ./gradlew :sdks:java:javadoc:aggregateJavadoc -PisRelease --no-daemon --no-parallel | |
- name: Build YAML Docs | |
working-directory: beam | |
run: | | |
./gradlew :sdks:python:generateYamlDocs -PisRelease | |
cat ${BEAM_ROOT_DIR}/sdks/python/build/yaml-ref.html | |
- name: Add canonical link into javadocs | |
uses: cicirello/javadoc-cleanup@v1 | |
with: | |
path-to-root: beam/sdks/java/javadoc/build/docs/javadoc | |
base-url-path: https://beam.apache.org/releases/javadoc/current/ | |
- name: Consolidate Release Docs to beam-site branch with symlinks | |
working-directory: beam-site | |
run: | | |
git checkout -b $BRANCH_NAME release-docs | |
echo "..........Copying generated javadoc into beam-site.........." | |
cp -r ${BEAM_ROOT_DIR}/sdks/java/javadoc/build/docs/javadoc/ javadoc/${{ github.event.inputs.RELEASE }} | |
# Update current symlink to point to the latest release | |
unlink javadoc/current | |
ln -s ${{ github.event.inputs.RELEASE }} javadoc/current | |
echo "............Copying generated pydoc into beam-site.........." | |
cp -r ${BEAM_ROOT_DIR}/sdks/python/target/docs/_build pydoc/${{ github.event.inputs.RELEASE }} | |
# Update current symlink to point to the latest release | |
unlink pydoc/current | |
ln -s ${{ github.event.inputs.RELEASE }} pydoc/current | |
echo "............Copying generated typedoc into beam-site.........." | |
mkdir -p typedoc | |
cp -r ${BEAM_ROOT_DIR}/sdks/typescript/docs typedoc/${{ github.event.inputs.RELEASE }} | |
# Update current symlink to point to the latest release | |
unlink typedoc/current | true | |
ln -s ${{ github.event.inputs.RELEASE }} typedoc/current | |
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 | |
# Update current symlink to point to the latest release | |
unlink yamldoc/current | true | |
ln -s ${{ github.event.inputs.RELEASE }} yamldoc/current | |
cat yamldoc/current/index.html | |
# - name: Create commit on beam-site branch | |
# working-directory: beam | |
# run: | | |
# # Get the commit from the beam repo, not the beam-site repo. | |
# RELEASE_COMMIT=$(git rev-list -n 1 "tags/${RC_TAG}") | |
# cd ${SITE_ROOT_DIR} | |
# git config user.name $GITHUB_ACTOR | |
# git config user.email actions@"$RUNNER_NAME".local | |
# git add -A | |
# git commit -m "Update beam-site for release ${{ github.event.inputs.RELEASE }}." -m "Content generated from commit ${RELEASE_COMMIT}." | |
# git push -f --set-upstream origin $BRANCH_NAME | |
# - name: Create beam-site PR | |
# working-directory: beam-site | |
# env: | |
# GH_TOKEN: ${{ github.event.inputs.REPO_TOKEN }} | |
# PR_TITLE: "Publish docs for ${{ github.event.inputs.RELEASE }} release" | |
# PR_BODY: "Content generated from https://github.com/apache/beam/tree/${{ env.RC_TAG }}." | |
# run: | | |
# gh pr create -t "$PR_TITLE" -b "$PR_BODY" --base release-docs |