diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index cd9c893..76abeb8 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -70,21 +70,21 @@ jobs: password: ${{ secrets.RH_REGISTRY_PASSWORD }} - name: Configure Podman Registry Mirror + env: + FBC_DIR: ${{ github.event.inputs.fbc_dir }} run: | + BUNDLE_REPO="${FBC_DIR}-bundle" mkdir -p ~/.config/containers cat < ~/.config/containers/registries.conf [[registry]] - prefix = "registry.redhat.io/rhtas/rhtas-operator-bundle" - location = "registry.redhat.io/rhtas/rhtas-operator-bundle" + prefix = "registry.redhat.io/rhtas/${BUNDLE_REPO}" + location = "registry.redhat.io/rhtas/${BUNDLE_REPO}" [[registry.mirror]] - location = "quay.io/securesign/rhtas-operator-bundle" - - [[registry.mirror]] - location = "quay.io/securesign/rhtas-operator-bundle-v1-3" + location = "quay.io/securesign/${BUNDLE_REPO}" EOF - echo "Registry mirror configured successfully." + echo "Registry mirror configured for ${BUNDLE_REPO}." - name: Process FBC Utilities env: @@ -98,8 +98,26 @@ jobs: export OCP_VERSION="$version" export GRAPH="${OCP_VERSION}/${FBC_DIR}/graph.yaml" export CATALOG_FILE="${OCP_VERSION}/${FBC_DIR}/catalog/${FBC_DIR}/catalog.json" - + echo "Processing ${OCP_VERSION}..." + + if [[ ! -f "$GRAPH" ]]; then + echo "graph.yaml not found for ${OCP_VERSION}/${FBC_DIR}. Creating seed..." + yq -n ' + .entries[0].defaultChannel = "stable" | + .entries[0].name = env(FBC_DIR) | + .entries[0].schema = "olm.package" | + .schema = "olm.template.basic" + ' > "$GRAPH" + echo "Created seed graph.yaml for ${OCP_VERSION}/${FBC_DIR}" + fi + + mkdir -p "$(dirname "$CATALOG_FILE")" + if [[ ! -f "$CATALOG_FILE" ]]; then + : > "$CATALOG_FILE" + echo "Created empty catalog.json for ${OCP_VERSION}/${FBC_DIR}" + fi + ./utils/configure_bundles.sh ./utils/configure_channels.sh ./utils/render_catalog.sh