|
| 1 | +name: Build catalog for OLM upgrade testing |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: ["openstack operator image builder"] |
| 6 | + types: |
| 7 | + - completed |
| 8 | + secrets: |
| 9 | + IMAGENAMESPACE: |
| 10 | + required: true |
| 11 | + QUAY_USERNAME: |
| 12 | + required: true |
| 13 | + QUAY_PASSWORD: |
| 14 | + required: true |
| 15 | + REDHATIO_USERNAME: |
| 16 | + required: true |
| 17 | + REDHATIO_PASSWORD: |
| 18 | + required: true |
| 19 | + |
| 20 | +env: |
| 21 | + imageregistry: 'quay.io' |
| 22 | + imagenamespace: ${{ secrets.IMAGENAMESPACE || secrets.QUAY_USERNAME }} |
| 23 | + latesttag: latest |
| 24 | + |
| 25 | +jobs: |
| 26 | + build-catalog: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + if: > |
| 29 | + github.event.workflow_run.conclusion == 'success' |
| 30 | +
|
| 31 | + steps: |
| 32 | + - name: Install Go |
| 33 | + uses: actions/setup-go@v4 |
| 34 | + with: |
| 35 | + go-version: ${{ inputs.go_version }} |
| 36 | + cache: false |
| 37 | + |
| 38 | + - name: Checkout openstack-operator repository |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + path: ./openstack-operator |
| 42 | + |
| 43 | + - name: Install opm |
| 44 | + uses: redhat-actions/openshift-tools-installer@v1 |
| 45 | + with: |
| 46 | + source: github |
| 47 | + opm: 'latest' |
| 48 | + |
| 49 | + - name: Log in to Quay Registry |
| 50 | + uses: redhat-actions/podman-login@v1 |
| 51 | + with: |
| 52 | + registry: ${{ env.imageregistry }} |
| 53 | + username: ${{ secrets.QUAY_USERNAME }} |
| 54 | + password: ${{ secrets.QUAY_PASSWORD }} |
| 55 | + |
| 56 | + - name: Log in to Red Hat Registry |
| 57 | + uses: redhat-actions/podman-login@v1 |
| 58 | + with: |
| 59 | + registry: registry.redhat.io |
| 60 | + username: ${{ secrets.REDHATIO_USERNAME }} |
| 61 | + password: ${{ secrets.REDHATIO_PASSWORD }} |
| 62 | + |
| 63 | + - name: Create the catalog index |
| 64 | + shell: bash |
| 65 | + run: ./openstack-operator/hack/catalog-build-olm-upgrade.sh |
| 66 | + env: |
| 67 | + #FIXME: these should be pulled from a YAML config in the main operator directory? |
| 68 | + MAIN_VERSION: 0.3.0 |
| 69 | + FEATURE_RELEASE_VERSION: 0.2.0 |
| 70 | + FEATURE_RELEASE_BRANCH: 18.0-fr2 |
| 71 | + BUNDLE: ${{ env.imageregistry }}/${{ env.imagenamespace }}/openstack-operator-bundle:${{ github.sha }} |
| 72 | + |
| 73 | + - name: Buildah Action |
| 74 | + id: build-operator-index-upgrade |
| 75 | + uses: redhat-actions/buildah-build@v2 |
| 76 | + with: |
| 77 | + image: openstack-operator-index-upgrade |
| 78 | + tags: ${{ env.latesttag }} ${{ github.sha }} |
| 79 | + containerfiles: | |
| 80 | + ./catalog.Dockerfile |
| 81 | +
|
| 82 | + - name: Push openstack-operator-index-upgrade To ${{ env.imageregistry }} |
| 83 | + uses: redhat-actions/push-to-registry@v2 |
| 84 | + with: |
| 85 | + image: ${{ steps.build-operator-index-upgrade.outputs.image }} |
| 86 | + tags: ${{ steps.build-operator-index-upgrade.outputs.tags }} |
| 87 | + registry: ${{ env.imageregistry }}/${{ env.imagenamespace }} |
| 88 | + username: ${{ secrets.QUAY_USERNAME }} |
| 89 | + password: ${{ secrets.QUAY_PASSWORD }} |
0 commit comments