From 6aee4159e712e79c0fafcb16f69cdf8f5ddfc622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Thu, 14 Sep 2023 19:55:26 +0300 Subject: [PATCH 1/2] Add ability to publish family providers for provider-updoc workflow --- .github/workflows/provider-updoc.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/provider-updoc.yml b/.github/workflows/provider-updoc.yml index df5d706..2229a84 100644 --- a/.github/workflows/provider-updoc.yml +++ b/.github/workflows/provider-updoc.yml @@ -2,13 +2,19 @@ name: Updoc on: workflow_call: + inputs: + subpackages: + description: "Subpackages to be published individually (e.g. monolith config ec2)" + default: "monolith" + required: false + type: string secrets: UPBOUND_CI_PROD_BUCKET_SA: required: true env: - GO_VERSION: '1.19' - UPTEST_VERSION: '83bd901' + GO_VERSION: "1.19" + UPTEST_VERSION: "83bd901" jobs: publish-docs: @@ -53,10 +59,19 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: sa.json PROVIDER_NAME: ${GITHUB_REPOSITORY#*/} VER_MAJOR_MINOR: v${GITHUB_REF#"refs/heads/release-"} + SUBPACKAGES: ${{ inputs.subpackages }} run: | if [[ "${GITHUB_REF##*/}" == release-* ]]; then - echo "Publishing Docs for ${{ env.PROVIDER_NAME }}, ${{ env.VER_MAJOR_MINOR }}" - go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir=./docs --name=${{ env.PROVIDER_NAME }} --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io + for s in $SUBPACKAGES; do + FAMILY_PROVIDER_NAME="${{ env.PROVIDER_NAME }}-$s" + DOCS_DIR="./docs/family" + if [ $s == 'monolith' ]; then + FAMILY_PROVIDER_NAME="${{ env.PROVIDER_NAME }}" + DOCS_DIR="./docs/monolith" + fi + echo "Publishing Docs for $FAMILY_PROVIDER_NAME, ${{ env.VER_MAJOR_MINOR }}" + go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir=“${DOCS_DIR}” --name=“${FAMILY_PROVIDER_NAME}” --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io + done else echo "This job can only be run on release branches" exit 1 From e6464dad6556abc7ab63fe6a3f6f0cac93fca593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Wed, 27 Sep 2023 17:10:47 +0300 Subject: [PATCH 2/2] Only publish monolith and config packages --- .github/workflows/provider-updoc.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/provider-updoc.yml b/.github/workflows/provider-updoc.yml index 2229a84..0ab1724 100644 --- a/.github/workflows/provider-updoc.yml +++ b/.github/workflows/provider-updoc.yml @@ -3,9 +3,9 @@ name: Updoc on: workflow_call: inputs: - subpackages: - description: "Subpackages to be published individually (e.g. monolith config ec2)" - default: "monolith" + providers: + description: 'Family provider names for which to publish the docs, e.g., "monolith config". The provider names should be space-delimited.' + default: 'monolith' required: false type: string secrets: @@ -59,18 +59,21 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: sa.json PROVIDER_NAME: ${GITHUB_REPOSITORY#*/} VER_MAJOR_MINOR: v${GITHUB_REF#"refs/heads/release-"} - SUBPACKAGES: ${{ inputs.subpackages }} + SUBPACKAGES: ${{ inputs.providers }} run: | if [[ "${GITHUB_REF##*/}" == release-* ]]; then for s in $SUBPACKAGES; do - FAMILY_PROVIDER_NAME="${{ env.PROVIDER_NAME }}-$s" + PROVIDER_PACKAGE_NAME="${{ env.PROVIDER_NAME }}-$s" DOCS_DIR="./docs/family" if [ $s == 'monolith' ]; then - FAMILY_PROVIDER_NAME="${{ env.PROVIDER_NAME }}" + PROVIDER_PACKAGE_NAME="${{ env.PROVIDER_NAME }}" DOCS_DIR="./docs/monolith" + elif [ $s == 'config' ]; then + PROVIDER_PACKAGE_NAME="provider-family-${GITHUB_REPOSITORY#*-}" + DOCS_DIR="./docs/family" fi - echo "Publishing Docs for $FAMILY_PROVIDER_NAME, ${{ env.VER_MAJOR_MINOR }}" - go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir=“${DOCS_DIR}” --name=“${FAMILY_PROVIDER_NAME}” --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io + echo "Publishing Docs for $PROVIDER_PACKAGE_NAME, ${{ env.VER_MAJOR_MINOR }} from $DOCS_DIR" + go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir=“${DOCS_DIR}” --name=“${PROVIDER_PACKAGE_NAME}” --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io done else echo "This job can only be run on release branches"