Skip to content

chore: update Operator Package Manager (opm) #96

chore: update Operator Package Manager (opm)

chore: update Operator Package Manager (opm) #96

Workflow file for this run

name: Dev builds
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
env:
OPERATOR_IMAGE_NAME: sumologic-kubernetes-collection-helm-operator-dev
BUNDLE_IMAGE_NAME: sumologic-kubernetes-collection-helm-operator-bundle-dev
CATALOG_IMAGE_NAME: sumologic-kubernetes-collection-helm-operator-catalog-dev
ECR_URL: public.ecr.aws/sumologic
LATEST_TAG: "latest"
steps:
- uses: actions/[email protected]
- name: Install Operator Package Manager (OPM)
run: |
sudo wget -q "https://github.com/operator-framework/operator-registry/releases/download/${OPM_VERSION}/linux-amd64-opm" -O /usr/bin/opm && sudo chmod +x /usr/bin/opm
env:
OPM_VERSION: v1.45.0
- name: Checkout submodules
run: git submodule update --init
- name: Extract tag
id: extract_tag
run: echo "tag=$(echo $(git describe --tags --always))" >> $GITHUB_OUTPUT
- name: Print tag
run: echo "Running release build for ${{ steps.extract_tag.outputs.tag }}"
- name: Extract release number
id: extract_release_number
# count git tags omitting rc versions
run: echo "release_number=$(echo $(git tag | sed '/rc/d' | wc -l))" >> $GITHUB_OUTPUT
- name: Log in to AWS Public ECR to publish operator
run: make login-ecr
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_OPERATOR_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_OPERATOR_DEV }}
- name: Build and push operator image
run: make docker-build docker-push \
IMG=${ECR_URL}/${OPERATOR_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }} \
VERSION=${{ steps.extract_tag.outputs.tag }} \
RELEASE_NUMBER=${{ steps.extract_release_number.outputs.release_number }}
- name: Set 'latest' tag for operator image
run: docker tag ${ECR_URL}/${OPERATOR_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }} ${ECR_URL}/${OPERATOR_IMAGE_NAME}:${LATEST_TAG}
- name: Push 'latest' tag for operator image
run: make docker-push IMG=${ECR_URL}/${OPERATOR_IMAGE_NAME}:${LATEST_TAG}
- name: Log in to AWS Public ECR to publish bundle
run: make login-ecr
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_BUNDLE_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_BUNDLE_DEV }}
- name: Build and push bundle image
run: make bundle-build bundle-push \
BUNDLE_IMG=${ECR_URL}/${BUNDLE_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }}
- name: Set 'latest' tag for bundle image
run: docker tag ${ECR_URL}/${BUNDLE_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }} ${ECR_URL}/${BUNDLE_IMAGE_NAME}:${LATEST_TAG}
- name: Push 'latest' tag for bundle image
run: make docker-push IMG=${ECR_URL}/${BUNDLE_IMAGE_NAME}:${LATEST_TAG}
- name: Log in to AWS Public ECR to publish catalog
run: make login-ecr
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_CATALOG_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_CATALOG_DEV }}
- name: Build and push catalog image
run: make catalog-build catalog-push \
CATALOG_IMG=${ECR_URL}/${CATALOG_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }} \
BUNDLE_IMGS=${ECR_URL}/${BUNDLE_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }}
- name: Set 'latest' tag for catalog image
run: docker tag ${ECR_URL}/${CATALOG_IMAGE_NAME}:${{ steps.extract_tag.outputs.tag }} ${ECR_URL}/${CATALOG_IMAGE_NAME}:${LATEST_TAG}
- name: Push 'latest' tag for catalog image
run: make docker-push IMG=${ECR_URL}/${CATALOG_IMAGE_NAME}:${LATEST_TAG}