-
Notifications
You must be signed in to change notification settings - Fork 27
176 lines (165 loc) · 5.6 KB
/
release.yaml
File metadata and controls
176 lines (165 loc) · 5.6 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Create release images and GitHub Release
on:
push:
tags:
- v*.*.*
env:
REGISTRY: ghcr.io
IMAGE_REPO: ghcr.io/clickhouse
VERSION: ${{ github.ref_name }}
permissions:
packages: write
attestations: write
id-token: write
contents: write
pull-requests: read
jobs:
release-operator-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.0
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set VERSION
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Build operator image
run: make docker-buildx-latest
release-operator-olm-images:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.0
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install jq
uses: dcarbone/install-jq-action@v3.2.0
- name: Set VERSION
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Build operator bundle image
run: make bundle bundle-buildx
- name: Build catalog
run: make catalog-buildx
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Mark catalog as latest
run: make catalog-push-latest
release-operator-helm-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Helm
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
- name: Set VERSION
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Log in registry
run: helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Package operator helm chart
run: make package-helmchart
- name: Build and push helm OCI image
run: make push-helmchart
- name: Build and push cluster chart OCI image
run: make push-cluster-chart
create-release:
runs-on: ubuntu-latest
needs:
- release-operator-image
- release-operator-olm-images
- release-operator-helm-chart
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Set VERSION
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Kustomize Build
run: |
make build-installer
mv dist/install.yaml dist/clickhouse-operator.yaml
- name: Install Helm
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
- name: Package helm chart
run: make package-helmchart
- name: Package cluster chart
run: make package-cluster-chart
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Save controller images
run: make docker-save
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v6.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
toTag: ${{ github.ref_name }}
configurationJson: |
{
"categories": [{
"title": "## 🚀 Features",
"labels": ["feature", "feat"]
},{
"title": "## 🐛 Fixes",
"labels": ["fix", "bug"]
}, {
"title": "## 🧪 Tests",
"labels": ["test"]
}, {
"title": "## 🧹 Chores",
"labels": ["chore"]
}, {
"title": "## 📦 Uncategorized",
"labels": []
}]
}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{github.ref_name }}
draft: true
body: |
## Install using the manifest
```
kubectl apply -f https://github.com/ClickHouse/clickhouse-operator/releases/download/${{github.ref_name}}/clickhouse-operator.yaml
```
## Install using helmchart
```
helm install clickhouse-operator oci://ghcr.io/clickhouse/clickhouse-operator-helm \
--version=${{env.VERSION}} \
--create-namespace \
-n clickhouse-operator-system
```
## Changelog
${{steps.build_changelog.outputs.changelog}}
generate_release_notes: false
append_body: true
files: |
dist/clickhouse-operator.yaml
clickhouse-operator-helm-${{env.VERSION}}.tgz
clickhouse-cluster-helm-${{env.VERSION}}.tgz
clickhouse-operator_${{env.VERSION}}_*.tar.gz