-
Notifications
You must be signed in to change notification settings - Fork 22
138 lines (134 loc) · 5.83 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#
# Copyright Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
env:
OPERATOR_SDK_DL_URL: https://github.com/operator-framework/operator-sdk/releases/download/v1.28.0
OPERATOR_SDK_CLI: ./operator-sdk
jobs:
version-check:
runs-on: ubuntu-latest
env:
CACHED_CSV_VERSION: .cache/csv_version.txt
CACHED_CSV_CONTAINER_IMAGE_TAG: .cache/csv_container_image_tag.txt
CACHED_CSV_NAME_TAG: .cache/csv_name_tag.txt
CACHED_BUNDLE_VERSION: .cache/bundle_version.txt
CACHED_BUNDLE_CONTAINER_IMAGE_TAG: .cache/bundle_container_image_tag.txt
CACHED_BUNDLE_NAME_TAG: .cache/bundle_name_tag.txt
CACHED_MANAGER_IMAGE_TAG: .cache/manager_image_tag.txt
steps:
- name: Checkout registry-operator source code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download yq
run: curl -sL https://github.com/mikefarah/yq/releases/download/v4.34.2/yq_linux_amd64 -o yq && chmod +x yq
- name: Cache version tags
env:
YQ_CLI: ./yq
run: mkdir -p .cache && bash .ci/cache_version_tags.sh
- name: Check if VERSION and version tags match release tag
run: bash check_version.sh ${{ github.ref_name }}
k8s-integration-test:
strategy:
matrix:
version: [1.25, 1.26]
needs: version-check
runs-on: ubuntu-latest
steps:
- name: Checkout registry-operator source code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: 'go.mod'
- name: Download operator-sdk
run: |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
- name: Verify the downloaded operator-sdk
run: |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E;
curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt;
curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc;
gpg -u "Operator SDK (release) <[email protected]>" --verify checksums.txt.asc;
grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c -
- name: Setup operator-sdk
run: |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
mv operator-sdk_${OS}_${ARCH} ${OPERATOR_SDK_CLI}
chmod +x ${OPERATOR_SDK_CLI}
- name: Setup Minikube
uses: manusa/actions-setup-minikube@3856c6fa039819f1c8e7e248b1fc5a8564e354c9 # v2.9.0
with:
minikube version: 'v1.31.2'
kubernetes version: "${{ matrix.version }}"
driver: 'docker'
github token: ${{ secrets.GITHUB_TOKEN }}
start args: '--memory 4096 --cpus 2'
- name: Set manager image pull policy to Never
uses: mikefarah/yq@0b34c9a00de1c575a34eea05af1d956a525c4fc1 # v4.34.2
with:
cmd: yq -i '(select(documentIndex == 1) | .spec.template.spec.containers[0].imagePullPolicy) = "Never"' 'config/manager/manager.yaml'
- name: Run integration testing on release image
env:
REGISTRY_OPERATOR: localhost/registry-operator:${{ github.ref_name }}
run: bash .ci/minikube_integration.sh
push-operator-image:
needs:
# uncomment and remove version-check when integration testing for k8s has been fixed
# https://github.com/devfile/api/issues/1313
# - k8s-1-26-integration-test
# - k8s-1-25-integration-test
- version-check
runs-on: ubuntu-latest
steps:
- name: Checkout registry-operator source code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Docker Build & Push - Registry Operator Release Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
repository: devfile/registry-operator
dockerfile: Dockerfile
tags: ${{ github.ref_name }}
push-operator-bundle:
needs:
# uncomment and remove version-check when integration testing for k8s has been fixed
# https://github.com/devfile/api/issues/1313
# - k8s-1-26-integration-test
# - k8s-1-25-integration-test
- version-check
runs-on: ubuntu-latest
steps:
- name: Checkout registry-operator source code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Docker Build & Push - Registry Operator Bundle Release Image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
repository: devfile/registry-operator-bundle
dockerfile: bundle.Dockerfile
tags: ${{ github.ref_name }}