-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (83 loc) · 3.31 KB
/
release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build and publish release containers to quay.io
on:
release:
types: [published]
# Manual dispatch: requires version string from github's GUI.
workflow_dispatch:
inputs:
version:
type: string
description: 'Version (Semating Versioning) for the new release. E.g: 0.0.1'
required: true
default: '0.0.1'
env:
REGISTRY: quay.io
REGISTRY_USER: redhat-best-practices-for-k8s
REPO_BASE_NAME: certsuite-operator
TERM: xterm-color
jobs:
publish_new_version:
name: Build and publish release containers to quay.io
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
steps:
- name: Set release version output var depending on the trigger type.
run: |
if [ ${GITHUB_EVENT_NAME} == "workflow_dispatch" ]; then
VERSION=${{ inputs.version }}
echo "Manually triggered workflow to make release ${VERSION}"
else
VERSION=${{ github.ref_name }}
echo "New release published: ${VERSION}"
fi
REPO=${REGISTRY}/${REGISTRY_USER}/${REPO_BASE_NAME}
echo "VERSION=${VERSION}" >> ${GITHUB_ENV}
echo "IMG=${REPO}:v${VERSION}" >> ${GITHUB_ENV}
echo "SIDECAR_IMG=${REPO}-sidecar:v${VERSION}" >> ${GITHUB_ENV}
echo "BUNDLE_IMG=${REPO}-bundle:v${VERSION}" >> ${GITHUB_ENV}
echo "CATALOG_IMG=${REPO}-catalog:v${VERSION}" >> ${GITHUB_ENV}
- name: Print release images versions
run: |
echo "Release version to build: ${VERSION}"
echo " - Controller : ${IMG}"
echo " - Sidecar : ${SIDECAR_IMG}"
echo " - Bundle : ${BUNDLE_IMG}"
echo " - Catalog : ${CATALOG_IMG}"
- name: Authenticate against Quay.io
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_ROBOT_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: 1.23.2
- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"
- name: Download operator-sdk
env:
OPERATOR_SDK_BIN: operator-sdk_linux_amd64
OPERATOR_SDK_DL_URL: https://github.com/operator-framework/operator-sdk/releases/download/v1.36.1
OPERATOR_SDK_DEST_FOLDER: /usr/local/bin
run: |
curl --location --remote-name ${OPERATOR_SDK_DL_URL}/${OPERATOR_SDK_BIN}
chmod +x ${OPERATOR_SDK_BIN}
sudo mv ${OPERATOR_SDK_BIN} ${OPERATOR_SDK_DEST_FOLDER}/operator-sdk
operator-sdk version
- name: Check out the repo.
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Build and push sidecar app image
run: docker build --no-cache -t "${SIDECAR_IMG}" -f certsuite-sidecar/Dockerfile . && docker push ${SIDECAR_IMG}
- name: Build and push controller image
run: make docker-build docker-push
- name: Build and push bundle image
run: |
rm bundle/manifests/* || true
make bundle
make bundle-build bundle-push
- name: Build and push catalog image
run: make catalog-build catalog-push