feat: helm oci release

Upload and sign helm chart.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
This commit is contained in:
Serge Logvinov
2023-07-31 19:53:27 +03:00
committed by Serge
parent dfd7c5fdc9
commit f8d17121dc
3 changed files with 73 additions and 0 deletions

18
.github/ISSUE_TEMPLATE/BUG_REPORT.md vendored Normal file
View File

@@ -0,0 +1,18 @@
---
name: Bug Report
about: Report a bug.
title: ""
labels: ""
assignees: ""
---
## Bug Report
### Description
### Logs
### Environment
- Plugin version:
- Kubernetes version: [`kubectl version --short`]

41
.github/workflows/release-charts.yaml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: HelmChart Release
on:
push:
branches:
- main
paths:
- 'charts/**'
jobs:
build-publish:
name: "Publish helm chart"
timeout-minutes: 10
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v3
- name: Install Cosign
uses: sigstore/cosign-installer@v3.1.1
- name: Github registry login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Helm release
timeout-minutes: 5
run: make helm-login helm-release
env:
HELM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -2,6 +2,7 @@ REGISTRY ?= ghcr.io
USERNAME ?= sergelogvinov USERNAME ?= sergelogvinov
PROJECT ?= proxmox-cloud-controller-manager PROJECT ?= proxmox-cloud-controller-manager
IMAGE ?= $(REGISTRY)/$(USERNAME)/$(PROJECT) IMAGE ?= $(REGISTRY)/$(USERNAME)/$(PROJECT)
HELMREPO ?= $(REGISTRY)/$(USERNAME)/charts
PLATFORM ?= linux/arm64,linux/amd64 PLATFORM ?= linux/arm64,linux/amd64
PUSH ?= false PUSH ?= false
@@ -85,6 +86,19 @@ helm-unit: ## Helm Unit Tests
@helm template -f charts/proxmox-cloud-controller-manager/ci/values.yaml \ @helm template -f charts/proxmox-cloud-controller-manager/ci/values.yaml \
proxmox-cloud-controller-manager charts/proxmox-cloud-controller-manager >/dev/null proxmox-cloud-controller-manager charts/proxmox-cloud-controller-manager >/dev/null
.PHONY: helm-login
helm-login: ## Helm Login
@echo "${HELM_TOKEN}" | helm registry login $(REGISTRY) --username $(USERNAME) --password-stdin
.PHONY: helm-release
helm-release: ## Helm Release
@rm -rf dist/
@helm package charts/proxmox-cloud-controller-manager -d dist
@helm push dist/proxmox-cloud-controller-manager-*.tgz oci://$(HELMREPO) 2>&1 | tee dist/.digest
@cosign sign --yes $(COSING_ARGS) $(HELMREPO)/proxmox-cloud-controller-manager@$$(cat dist/.digest | awk -F "[, ]+" '/Digest/{print $$NF}')
############
.PHONY: docs .PHONY: docs
docs: docs:
helm template -n kube-system proxmox-cloud-controller-manager \ helm template -n kube-system proxmox-cloud-controller-manager \