Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .github/workflows/publish-docs-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ on: # yamllint disable-line rule:truthy
required: false
default: false
type: boolean

airflow-base-version:
required: false
description: "Override the Airflow Base Version to use for the docs build"
type: string
airflow-version:
required: false
description: "Override the Airflow Version to use for the docs build"
type: string
permissions:
contents: read
jobs:
Expand All @@ -69,6 +76,8 @@ jobs:
DESTINATION: ${{ inputs.destination }}
SKIP_WRITE_TO_STABLE_FOLDER: ${{ inputs.skip-write-to-stable-folder }}
BUILD_SBOMS: ${{ inputs.build-sboms }}
AIRFLOW_BASE_VERSION: ${{ inputs.airflow-base-version || '' }}
AIRFLOW_VERSION: ${{ inputs.airflow-version || '' }}
outputs:
include-docs: ${{ inputs.include-docs == 'all' && '' || inputs.include-docs }}
destination-location: ${{ steps.parameters.outputs.destination-location }}
Expand Down Expand Up @@ -102,6 +111,8 @@ jobs:
echo "Destination: '${DESTINATION}'"
echo "Skip write to stable folder: '${SKIP_WRITE_TO_STABLE_FOLDER}'"
echo "Build SBOMs: '${BUILD_SBOMS}'"
echo "Airflow Base Version: '${AIRFLOW_BASE_VERSION}'"
echo "Airflow Version: '${AIRFLOW_VERSION}'"
if [[ "${DESTINATION}" == "auto" ]]; then
if [[ "${REF}" =~ ^.*[0-9]*\.[0-9]*\.[0-9]*$ ]]; then
echo "${REF} looks like final release, using live destination"
Expand All @@ -118,8 +129,20 @@ jobs:
echo "destination-location=s3://staging-docs-airflow-apache-org/docs/" >> ${GITHUB_OUTPUT}
fi
if [[ " ${INCLUDE_DOCS} " =~ " apache-airflow " ]]; then
AIRFLOW_BASE_VERSION=$(echo "${REF}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
AIRFLOW_VERSION="${REF}"
if [[ ${AIRFLOW_BASE_VERSION=} == "" && ${AIRFLOW_VERSION=} == "" ]]; then
echo "No Airflow Versions provided, using ${REF} to determine it."
AIRFLOW_VERSION="${REF}"
set +e
AIRFLOW_BASE_VERSION=$(echo "${REF}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
set -e
if [[ ${AIRFLOW_BASE_VERSION=} == "" ]]; then
echo
echo "No Airflow Base Version found in ${REF}"
echo "You need to force airflow version and airflow base version in the workflow."
echo
exit 1
fi
fi
echo "airflow-base-version=${AIRFLOW_BASE_VERSION}" >> ${GITHUB_OUTPUT}
echo "airflow-version=${AIRFLOW_VERSION}" >> ${GITHUB_OUTPUT}
else
Expand Down
Loading