From 4404fc3b2d1af54ef662499a35ec24f69b61b09b Mon Sep 17 00:00:00 2001 From: DanielePalaia Date: Mon, 27 Jan 2025 09:13:33 +0100 Subject: [PATCH] adding back replaces field on operatorhub publication --- .../testing_and_publishing_OLM_bundle.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing_and_publishing_OLM_bundle.yml b/.github/workflows/testing_and_publishing_OLM_bundle.yml index 6292d9a79..ac6f14e80 100644 --- a/.github/workflows/testing_and_publishing_OLM_bundle.yml +++ b/.github/workflows/testing_and_publishing_OLM_bundle.yml @@ -3,14 +3,15 @@ name: Test & Publish OLM Package on: - release: - types: [published] + push: + branches: + - add_replace_field_on_olm_operatorhub workflow_dispatch: inputs: bundle_version: description: 'The version of the bundle in format 1.2.3 (do not prefix with "v")' - default: "" + default: "0.0.0" required: false type: string @@ -183,7 +184,7 @@ jobs: name: Create branch for OperatorHub PR runs-on: ubuntu-latest needs: test-olm-package - if: ${{ startsWith(github.ref, 'refs/tags/v') }} + #if: ${{ startsWith(github.ref, 'refs/tags/v') }} steps: - name: Checkout community-operators fork (OperatorHub) uses: actions/checkout@v4 @@ -209,7 +210,10 @@ jobs: git branch rabbitmq-cluster-operator-$BUNDLE_VERSION git checkout rabbitmq-cluster-operator-$BUNDLE_VERSION + REPLACE_VERSION=$(ls -1v ./operators/rabbitmq-cluster-operator/ | tail -2 | head -1) + cp -v -fR olm-package-ci/"$BUNDLE_VERSION" ./operators/rabbitmq-cluster-operator/ + sed -i -e "s/replaces: null/replaces: rabbitmq-cluster-operator.v$REPLACE_VERSION/g" ./operators/rabbitmq-cluster-operator/$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml sed -i -e "s/latest/$BUNDLE_VERSION/g" ./operators/rabbitmq-cluster-operator/$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml git add operators/rabbitmq-cluster-operator git commit -s -m "RabbitMQ Operator release $BUNDLE_VERSION" @@ -219,7 +223,7 @@ jobs: name: Create branch for Openshift marketplace PR runs-on: ubuntu-latest needs: test-olm-package - if: ${{ startsWith(github.ref, 'refs/tags/v') }} + #if: ${{ startsWith(github.ref, 'refs/tags/v') }} steps: - name: Checkout community-operators-prod fork (Openshift Ecosystem) uses: actions/checkout@v4