-
Notifications
You must be signed in to change notification settings - Fork 22
89 lines (83 loc) · 3.01 KB
/
release.yaml
File metadata and controls
89 lines (83 loc) · 3.01 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
name: Create release images and GitHub Release
on:
push:
tags:
- v*.*.*
env:
REGISTRY: ghcr.io
IMAGE_NAME: clickhouse/clickhouse-operator
IMAGE_TAG_BASE: ghcr.io/clickhouse/clickhouse-operator/clickhouse-operator
VERSION: ${{ github.ref_name }}
jobs:
release:
permissions:
packages: write
attestations: write
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- 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: Build operator image
run: make docker-buildx
- name: Build operator bundle image
run: make bundle bundle-buildx
- name: Kustomize Build
uses: karancode/kustomize-github-action@master
with:
token: ${{ github.token }}
kustomize_version: 5.7.1
kustomize_build_dir: "config/default"
kustomize_output_file: "dist/clickhouse-operator.yaml"
- name: Package helm chart
run: helm package --version ${VERSION} --app-version v${VERSION} dist/chart
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: ${{github.ref_name }}
body: |
Pull latest operator images:
```
docker pull ghcr.io/clickhouse/clickhouse-operator/clickhouse-operator:${{ github.ref_name }}
docker pull ghcr.io/clickhouse/clickhouse-operator/clickhouse-operator-bundle:${{ github.ref_name }}
```
To deploy this release use
```
kubectl apply -f https://github.com/ClickHouse/clickhouse-operator/releases/download/${{github.ref_name}}/clickhouse-operator.yaml
```
generate_release_notes: true
append_body: true
files: |
dist/clickhouse-operator.yaml
dist/chart/clickhouse-operator-${VERSION}.tgz
- name: Push chart and updated index
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git reset --hard
git fetch origin helm-releases
git checkout helm-releases
find .
helm repo index .
git add index.yaml
git add clickhouse-operator-${VERSION}.tgz
git commit -m "Add chart $VERSION"
git push origin helm-releases