Skip to content

Commit

Permalink
add helm test and publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
eljohnson92 committed Feb 14, 2024
1 parent 8470afb commit 953920a
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Helm

on:
push:
branches:
- main
paths:
- 'deploy/chart/**'
pull_request:
paths:
- 'deploy/chart/**'
workflow_dispatch: {}

permissions:
contents: read

jobs:
helm-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Version
run: |
TAG=$(git describe --tags --abbrev=0)
sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG#v}/g" deploy/chart/Chart.yaml
sed -ie "s/version: 0.0.0/version: ${TAG#v}/g" deploy/chart/Chart.yaml
- name: Set up Helm
uses: azure/setup-helm@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false --chart-dirs deploy --target-branch ${{ github.event.repository.default_branch }}

# we cannot test a helm install without a valid linode
# - name: Create kind cluster
# uses: helm/[email protected]

#- name: Run chart-testing (install)
# run: ct install --chart-dirs helm-chart --namespace kube-system --helm-extra-set-args "--set=apiToken=test --set=region=us-east" --target-branch ${{ github.event.repository.default_branch }}

helm-release:
if: github.ref == 'refs/heads/main'
needs: helm-test
permissions:
contents: write # for helm/chart-releaser-action to push chart release and create a release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Version
run: |
TAG=$(git describe --tags --abbrev=0)
sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG#v}/g" deploy/chart/Chart.yaml
sed -ie "s/version: 0.0.0/version: ${TAG#v}/g" deploy/chart/Chart.yaml
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@v3

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_dir: deploy
skip_existing: true
4 changes: 3 additions & 1 deletion deploy/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ apiVersion: v2
name: ccm-linode
description: The Linode Cloud Controller Manager (CCM) provides a way for Kubernetes clusters to access additional Linode services. Linode's CCM will automatically provision a Linode NodeBalancer for Kubernetes Services of type "LoadBalancer".
type: application
version: 1.0.0
version: 0.0.0
appVersion: "latest"
maintainers:
- name: linode
2 changes: 1 addition & 1 deletion deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ tolerations:
# LINODE_HOSTNAME_ONLY_INGRESS type bool is supported
# env:
# - name: EXAMPLE_ENV_VAR
# value: "true"
# value: "true"

0 comments on commit 953920a

Please sign in to comment.