-
Notifications
You must be signed in to change notification settings - Fork 7
109 lines (94 loc) · 3.8 KB
/
release.yml
File metadata and controls
109 lines (94 loc) · 3.8 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
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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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)" >> $GITHUB_OUTPUT
echo "values_version=$(yq '.deployment.image.tag' chart/values.yaml)" >> $GITHUB_OUTPUT
echo "chart_version=$(yq '.appVersion' chart/Chart.yaml)" >> $GITHUB_OUTPUT
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
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: ${{ github.event.release.tag_name }}"
echo "catalog_version: ${{ needs.release.outputs.catalog_version }}"
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.version }}" ]; then
echo "Version in Makefile does not match release tag"
exit 1
fi
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.values_version }}" ]; then
echo "Version in chart/values.yaml does not match release tag"
exit 1
fi
if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.chart_version }}" ]; then
echo "Version in chart/Chart.yaml does not match release tag"
exit 1
fi
if [ "${{ github.event.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: 🔐 Login into ${{ env.REGISTRY }}
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🖥️ Set up QEMU (multi-arch emulation)
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # 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