diff --git a/.github/workflows/testing_and_publishing_OLM_bundle.yml b/.github/workflows/testing_and_publishing_OLM_bundle.yml index 91acfc59c..b058710d1 100644 --- a/.github/workflows/testing_and_publishing_OLM_bundle.yml +++ b/.github/workflows/testing_and_publishing_OLM_bundle.yml @@ -185,33 +185,23 @@ jobs: kubectl config use-context admin ./OLM-Package-Repo/testfiles/uninstall-rabbitmq-cluster-operator.sh $OLM_INDEX_TAG - publish-bundle: + publish-bundle-operatorhub: name: Publish on OperatorHub and Openshift marketplace runs-on: ubuntu-latest needs: test-olm-package # if: ${{ startsWith(github.ref, 'refs/tags/v') }} steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Checkout community-operators fork (OperatorHub) uses: actions/checkout@v4 with: repository: rabbitmq/community-operators - path: ./community-operators - token: ${{ secrets.RABBITMQ_CI_TOKEN }} - - - name: Checkout community-operators-prod fork (Openshift Ecosystem) - uses: actions/checkout@v4 - with: - repository: rabbitmq/community-operators-prod - path: ./community-operators-prod token: ${{ secrets.RABBITMQ_CI_TOKEN }} - name: Download OLM artifact uses: actions/download-artifact@v4 with: name: olm-artifact + path: olm-package-ci - name: Create branch for OperatorHub PR env: @@ -219,39 +209,56 @@ jobs: # RABBITMQ_CI_EMAIL: secret_rabbitmq/kv/Shared-Shared-RabbitMQ%2Frabbitmq-ci/details # RABBITMQ_CI_TOKEN: secret_rabbitmq/kv/Shared-Shared-RabbitMQ%2Frabbitmq-ci/details run: | - mkdir -p community-operators/operators/rabbitmq-cluster-operator - pushd community-operators/operators/rabbitmq-cluster-operator || exit 1 + mkdir -pv operators/rabbitmq-cluster-operator git config --local user.name "rabbitmq-ci" git config --local user.email ${{ secrets.RABBITMQ_CI_EMAIL }} git branch rabbitmq-cluster-operator-$BUNDLE_VERSION git checkout rabbitmq-cluster-operator-$BUNDLE_VERSION REPLACE_VERSION=$(ls -1v | tail -2 | head -1) - cp -fR ./../../../$BUNDLE_VERSION . - sed -i -e "s/replaces: null/replaces: rabbitmq-cluster-operator.v$REPLACE_VERSION/g" ./$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml - sed -i -e "s/latest/$BUNDLE_VERSION/g" ./$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml + 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 . - git commit -s -m "RabbitMQ operator new release" + git commit -s -m "RabbitMQ Operator release $BUNDLE_VERSION" git push --set-upstream origin rabbitmq-cluster-operator-$BUNDLE_VERSION popd + + publish-bundle-redhat-marketplace: + name: Publish on OperatorHub and Openshift marketplace + runs-on: ubuntu-latest + needs: test-olm-package +# if: ${{ startsWith(github.ref, 'refs/tags/v') }} + steps: + - name: Checkout community-operators-prod fork (Openshift Ecosystem) + uses: actions/checkout@v4 + with: + repository: rabbitmq/community-operators-prod + token: ${{ secrets.RABBITMQ_CI_TOKEN }} + + - name: Download OLM artifact + uses: actions/download-artifact@v4 + with: + name: olm-artifact + path: olm-package-ci + - name: Create branch for Openshift Ecosystem PR env: BUNDLE_VERSION: ${{ needs.test-olm-package.outputs.olm_package_version }} # RABBITMQ_CI_EMAIL: secret_rabbitmq/kv/Shared-Shared-RabbitMQ%2Frabbitmq-ci/details # RABBITMQ_CI_TOKEN: secret_rabbitmq/kv/Shared-Shared-RabbitMQ%2Frabbitmq-ci/details run: | - cd community-operators-prod/operators/rabbitmq-cluster-operator + mkdir -pv operators/rabbitmq-cluster-operator git config --local user.name "rabbitmq-ci" git config --local user.email ${{ secrets.RABBITMQ_CI_EMAIL }} git branch rabbitmq-cluster-operator-$BUNDLE_VERSION git checkout rabbitmq-cluster-operator-$BUNDLE_VERSION REPLACE_VERSION=$(ls -1v | tail -2 | head -1) - cp -fR ./../../../$BUNDLE_VERSION-openshift . - mv $BUNDLE_VERSION-openshift $BUNDLE_VERSION - sed -i -e "s/replaces: null/replaces: rabbitmq-cluster-operator.v$REPLACE_VERSION/g" ./$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml - sed -i -e "s/latest/$BUNDLE_VERSION/g" ./$BUNDLE_VERSION/manifests/rabbitmq.clusterserviceversion.yaml + cp -v -fR olm-package-ci/"$BUNDLE_VERSION-openshift" ./operators/rabbitmq-cluster-operator/"$BUNDLE_VERSION" + 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 . - git commit -s -m "RabbitMQ operator new release" + git commit -s -m "RabbitMQ Operator release $BUNDLE_VERSION" git push --set-upstream origin rabbitmq-cluster-operator-$BUNDLE_VERSION \ No newline at end of file