-
Notifications
You must be signed in to change notification settings - Fork 153
77 lines (75 loc) · 2.92 KB
/
build-push-images.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build and Push Images
on:
push:
branches:
- main
- release-1*
paths-ignore:
- "docs/**"
- "images/**"
- "automation/**"
- "cluster/**"
- "renovate.json"
jobs:
build_push:
if: (github.repository == 'kubevirt/hyperconverged-cluster-operator')
name: Build and Push Images
runs-on: ubuntu-latest
env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
REGISTRY_NAMESPACE: kubevirt
OPM_VERSION: v1.47.0
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Get latest version
run: |
PACKAGE_DIR="./deploy/olm-catalog/community-kubevirt-hyperconverged"
CSV_VERSION=$(ls -d ${PACKAGE_DIR}/*/ | sort -rV | awk "NR==$((RELEASE_DELTA+1))" | cut -d '/' -f 5)
echo "CSV_VERSION=${CSV_VERSION}" >> $GITHUB_ENV
echo "PACKAGE_DIR=${PACKAGE_DIR}" >> $GITHUB_ENV
- name: set unstable tag
# This workflow always pushes unstable tags, both from main and release branches.
run: |
echo "IMAGE_TAG=${CSV_VERSION}-unstable" >> $GITHUB_ENV
echo "UNSTABLE=UNSTABLE" >> $GITHUB_ENV
- name: Build Applications Images
env:
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
IMAGE_TAG=${IMAGE_TAG} make container-build
- name: Push Application Images
env:
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
make quay-login
IMAGE_TAG=${IMAGE_TAG} make container-push
- name: Build Digester
run: |
(cd tools/digester && go build .)
- name: Build Manifests with unique CSV semver
env:
IMAGE_TAG: ${{ env.IMAGE_TAG }}
PACKAGE_DIR: ${{ env.PACKAGE_DIR }}
CSV_VERSION: ${{ env.CSV_VERSION }}
run: |
export HCO_OPERATOR_IMAGE=$(tools/digester/digester --image="quay.io/kubevirt/hyperconverged-cluster-operator:${IMAGE_TAG}")
export HCO_WEBHOOK_IMAGE=$(tools/digester/digester --image="quay.io/kubevirt/hyperconverged-cluster-webhook:${IMAGE_TAG}")
export HCO_DOWNLOADS_IMAGE=$(tools/digester/digester --image="quay.io/kubevirt/virt-artifacts-server:${IMAGE_TAG}")
./hack/build-manifests.sh UNIQUE
sed -i "/^ \+replaces:/d" ${PACKAGE_DIR}/${CSV_VERSION}/manifests/kubevirt-hyperconverged-operator.v${CSV_VERSION}.clusterserviceversion.yaml
- name: Get opm client
run: |
wget https://github.com/operator-framework/operator-registry/releases/download/${OPM_VERSION}/linux-amd64-opm
chmod +x linux-amd64-opm
- name: Build and Push the Index Image
run: |
export OPM=$(pwd)/linux-amd64-opm
./hack/build-index-image.sh latest ${{ env.UNSTABLE }}