Repository navigation
113 lines (98 loc) · 3.76 KB
/
Copy pathrelease.yml
File metadata and controls
113 lines (98 loc) · 3.76 KB
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
name: 🚀 Release
permissions: read-all
on:
release:
types:
- created
env:
REGISTRY: ghcr.io
IMAGE_NAME: inditextech/k8s-overcommit-operator
jobs:
release:
name: 🏷️ Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
values_version: ${{ steps.version.outputs.values_version }}
chart_version: ${{ steps.version.outputs.chart_version }}
catalog_version: ${{ steps.version.outputs.catalog_version }}
steps:
- name: 🛎️ Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
with:
fetch-depth: 0
- name: Check bundle generation 🧪
run: |
make bundle
git diff --ignore-matching-lines='.*createdAt:.*' --exit-code
- name: 📝 Load Operator version
id: version
run: |
{
echo "version=$(make print-VERSION | cut -d'=' -f2)"
echo "values_version=$(yq '.deployment.image.tag' chart/values.yaml)"
echo "chart_version=$(yq '.appVersion' chart/Chart.yaml)"
echo "catalog_version=$(yq '.spec.image' deploy/catalog_source.yaml | cut -d':' -f2)"
} >> "$GITHUB_OUTPUT"
echo "$GITHUB_OUTPUT"
check:
name: 🔎 Check versions
needs: release
runs-on: ubuntu-latest
steps:
- name: 🔎 Check versions
env:
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
run: |
echo "version: ${{ needs.release.outputs.version }}"
echo "values_version: ${{ needs.release.outputs.values_version }}"
echo "chart_version: ${{ needs.release.outputs.chart_version }}"
echo "tag_name: $RELEASE_TAG_NAME"
echo "catalog_version: ${{ needs.release.outputs.catalog_version }}"
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.version }}" ]; then
echo "Version in Makefile does not match release tag"
exit 1
fi
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.values_version }}" ]; then
echo "Version in chart/values.yaml does not match release tag"
exit 1
fi
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.chart_version }}" ]; then
echo "Version in chart/Chart.yaml does not match release tag"
exit 1
fi
if [ "$RELEASE_TAG_NAME" != "${{ needs.release.outputs.catalog_version }}" ]; then
echo "Version in deploy/catalog_source.yaml does not match release tag"
exit 1
fi
build:
name: 🛠️ Build Operator images
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: 🛎️ Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
with:
fetch-depth: 0
- name: 🔐 Login into ${{ env.REGISTRY }}
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🖥️ Set up QEMU (multi-arch emulation)
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v3
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@594f3bf4285d9ea8dc53c9a0c9c4092420091003 # v3
- name: 🏗️ Build and push Operator image (multi-arch)
run: |
make docker-buildx PLATFORMS=linux/amd64,linux/arm64
- name: 🏗️ Build and push Operator bundle
run: |
make bundle-build bundle-push
- name: 🏗️ Build and push Operator catalog
run: |
make catalog-build catalog-push