Skip to content

chore: release: prepare v4.9.0-2 #16

chore: release: prepare v4.9.0-2

chore: release: prepare v4.9.0-2 #16

Workflow file for this run

name: Releases
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+-rc.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+.[0-9]+-rc.[0-9]+'
jobs:
build:
runs-on: ubuntu-22.04
env:
OPERATOR_IMAGE_NAME: sumologic-kubernetes-collection-helm-operator
BUNDLE_IMAGE_NAME: sumologic-kubernetes-collection-helm-operator-bundle
CATALOG_IMAGE_NAME: sumologic-kubernetes-collection-helm-operator-catalog
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 ${GITHUB_REF#refs/tags/v})" >> $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 }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_OPERATOR }}
- 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 }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_BUNDLE }}
- 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 }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_CATALOG }}
- 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}