-
Notifications
You must be signed in to change notification settings - Fork 50
147 lines (125 loc) · 4.6 KB
/
Copy pathrelease.yml
File metadata and controls
147 lines (125 loc) · 4.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
name: release
on:
push:
tags:
- 'v*'
branches:
- main
workflow_dispatch:
permissions:
contents: write
packages: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
REPO: kagenti/kagenti-operator
CHARTS_PATH: ./charts
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to ghcr.io
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# --- kagenti-operator image ---
- name: Extract Docker metadata (kagenti-operator)
id: operator-meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/kagenti-operator
tags: |
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- name: Build and push kagenti-operator
uses: docker/build-push-action@v7
with:
context: ./kagenti-operator
file: ./kagenti-operator/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.operator-meta.outputs.tags }}
labels: ${{ steps.operator-meta.outputs.labels }}
# --- agentcard-signer image ---
- name: Extract Docker metadata (agentcard-signer)
id: signer-meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/agentcard-signer
tags: |
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- name: Build and push agentcard-signer
uses: docker/build-push-action@v7
with:
context: ./kagenti-operator
file: ./kagenti-operator/cmd/agentcard-signer/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.signer-meta.outputs.tags }}
labels: ${{ steps.signer-meta.outputs.labels }}
# --- Release-only steps (tag pushes) ---
- name: Set up Helm
if: github.ref_type == 'tag'
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install yq
if: github.ref_type == 'tag'
uses: mikefarah/yq@v4
- name: Package and push Helm chart
if: github.ref_type == 'tag'
run: |
chartVersion=$(echo "${{ github.ref_name }}" | cut -c 2-)
chartPackageName="kagenti-operator-chart-${chartVersion}.tgz"
cd ${{ env.CHARTS_PATH }}/kagenti-operator
yq -i '.controllerManager.container.image.tag = strenv(chartVersion)' values.yaml
yq -i '.controllerManager.container.image.pullPolicy = "IfNotPresent"' values.yaml
helm package . --destination . --version "${chartVersion}" --app-version "${chartVersion}"
helm push "./${chartPackageName}" oci://${{ env.REGISTRY }}/${{ env.REPO }}
- name: Create GitHub Release
if: github.ref_type == 'tag'
run: gh release create "${{ github.ref_name }}" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
e2e-helm-install:
needs: build-and-push
if: github.ref_type != 'tag'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Create Kind cluster
uses: helm/kind-action@v1
- name: Install cert-manager
run: |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.2/cert-manager.yaml
kubectl -n cert-manager rollout status deployment/cert-manager --timeout=90s
kubectl -n cert-manager rollout status deployment/cert-manager-webhook --timeout=90s
kubectl -n cert-manager rollout status deployment/cert-manager-cainjector --timeout=90s
- name: Install Helm chart
run: |
helm install kagenti-operator ./charts/kagenti-operator
- name: Wait for deployment rollout
run: |
kubectl rollout status deployment/kagenti-controller-manager \
--timeout=120s
- name: Verify operator pod is Running and Ready
run: |
kubectl wait pods \
-l control-plane=controller-manager \
--for=condition=Ready \
--timeout=60s
kubectl get pods -l control-plane=controller-manager