Skip to content

Commit

Permalink
feat: helm oci release
Browse files Browse the repository at this point in the history
Upload and sign helm chart.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
  • Loading branch information
sergelogvinov committed Jul 31, 2023
1 parent dfd7c5f commit f8d1712
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -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 changes: 41 additions & 0 deletions .github/workflows/release-charts.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ REGISTRY ?= ghcr.io
USERNAME ?= sergelogvinov
PROJECT ?= proxmox-cloud-controller-manager
IMAGE ?= $(REGISTRY)/$(USERNAME)/$(PROJECT)
HELMREPO ?= $(REGISTRY)/$(USERNAME)/charts
PLATFORM ?= linux/arm64,linux/amd64
PUSH ?= false

Expand Down Expand Up @@ -85,6 +86,19 @@ helm-unit: ## Helm Unit Tests
@helm template -f charts/proxmox-cloud-controller-manager/ci/values.yaml \
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
docs:
helm template -n kube-system proxmox-cloud-controller-manager \
Expand Down

0 comments on commit f8d1712

Please sign in to comment.