Skip to content

Commit cf9584e

Browse files
committed
Add crd only chart, that installs CRDs unconditionally
not happy with that, but it seems that's the preferable way currently. Chart is auto-version on every CRD changed and pushed to ghcr.
1 parent f81beaf commit cf9584e

4 files changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Helm CRD OCI Package GHCR
5+
"on":
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'charts/openstack-hypervisor-operator/crds/**'
11+
workflow_dispatch: {}
12+
permissions:
13+
contents: read
14+
packages: write
15+
jobs:
16+
build-and-push-helm-crd-package:
17+
name: Build and publish Helm CRD Chart OCI
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v6
22+
- name: Install Helm
23+
uses: azure/setup-helm@v4
24+
- name: Sync CRDs from main chart
25+
run: cp charts/openstack-hypervisor-operator/crds/*.yaml charts/openstack-hypervisor-operator-crd/templates/
26+
- name: Lint Helm Chart
27+
run: helm lint charts/openstack-hypervisor-operator-crd
28+
- name: Package Helm Chart
29+
run: |
30+
# Use run number to auto-increment version on each CRD change
31+
VERSION="1.0.${{ github.run_number }}"
32+
echo "Running helm package with version $VERSION"
33+
helm package charts/openstack-hypervisor-operator-crd --destination ./chart --version "$VERSION"
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@v4
36+
with:
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
registry: ghcr.io
39+
username: ${{ github.actor }}
40+
- name: Push Helm Chart to ghcr.io
41+
run: helm push ./chart/*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Patterns to ignore when building packages.
2+
.DS_Store
3+
*.swp
4+
*.bak
5+
*.tmp
6+
*~
7+
.git
8+
.gitignore
9+
.bzr
10+
.bzrignore
11+
.hg
12+
.hgignore
13+
.svn
14+
.empty
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: openstack-hypervisor-operator-crd
3+
description: CRDs for the OpenStack Hypervisor Operator
4+
appVersion: latest
5+
version: 1.0.0
6+
type: application

charts/openstack-hypervisor-operator-crd/templates/.empty

Whitespace-only changes.

0 commit comments

Comments
 (0)