Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bundle generation #158

Merged
merged 4 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,17 @@ jobs:
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
id: add-latest-tag
run: |
echo "TAG_NAME=latest" >> $GITHUB_ENV
echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV
- name: Add release tag
- name: Add tag based on branch
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
id: add-branch-tag
run: |
if [[ ${GITHUB_REF_NAME/\//-} =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
TAG_NAME=${GITHUB_REF_NAME/\//-}
else
TAG_NAME=${{ github.sha }}
fi
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
echo "IMG_TAGS=${TAG_NAME} ${{ env.IMG_TAGS }}" >> $GITHUB_ENV
- name: Set Operator version
Expand All @@ -127,13 +132,20 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Run make bundle
- name: Run make bundle for workflow dispatch and workflow call
id: workflow-dispatch-call
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
run: |
make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} \
VERSION=${TAG_NAME/v/} IMAGE_TAG=${{ github.sha }} \
VERSION=${{ env.VERSION }} IMAGE_TAG=${{ env.TAG_NAME }} \
AUTHORINO_OPERATOR_VERSION=${{ inputs.authorinoOperatorBundleVersion }} \
LIMITADOR_OPERATOR_VERSION=${{ inputs.limitadorOperatorBundleVersion }} \
WASM_SHIM_VERSION=${{ inputs.wasmShimVersion }}
- name: Run make bundle for regular events
id: workflow-regular-events
if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' }}
run: |
make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} VERSION=${{ env.VERSION }}
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ is_semantic_version = $(shell [[ $(1) =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$$ ]] && e
# BUNDLE_VERSION defines the version for the kuadrant-operator bundle.
# If the version is not semantic, will use the default one
bundle_is_semantic := $(call is_semantic_version,$(VERSION))
ifeq ($(bundle_is_semantic),true)
ifeq (0.0.0,$(VERSION))
BUNDLE_VERSION = $(VERSION)
IMAGE_TAG = latest
else ifeq ($(bundle_is_semantic),true)
BUNDLE_VERSION = $(VERSION)
IMAGE_TAG = v$(VERSION)
else
Expand All @@ -60,12 +63,6 @@ ORG ?= kuadrant
# quay.io/kuadrant/kuadrant-operator-bundle:$VERSION and quay.io/kuadrant/kuadrant-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= $(REGISTRY)/$(ORG)/kuadrant-operator

ifeq (0.0.0,$(VERSION))
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
IMAGE_TAG ?= latest
else
IMAGE_TAG ?= v$(VERSION)
endif

# kubebuilder-tools still doesn't support darwin/arm64. This is a workaround (https://github.com/kubernetes-sigs/controller-runtime/issues/1657)
ARCH_PARAM =
ifeq ($(shell uname -sm),Darwin arm64)
Expand Down