Skip to content

Commit

Permalink
chore!: Chart Publications via Github Workflow (#741)
Browse files Browse the repository at this point in the history
* feat: Move Linting to Github Actions

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
  • Loading branch information
oliverbaehler authored May 21, 2021
1 parent 35c7543 commit 9a3077a
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 87 deletions.
28 changes: 4 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,13 @@ jobs:
- image: quay.io/helmpack/chart-testing:v3.3.1
steps:
- checkout
- run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml

# Technically this only needs to be run on master, but it's good to have it run on every PR
# so that it is regularly tested.
- run: ct lint --config .github/configs/ct-lint.yaml --lint-conf .github/configs/lintconf.yaml
publish:
docker:
# We just need an image with `helm` on it. Handily we know of one already.
- image: quay.io/helmpack/chart-testing:v3.3.1
- image: bash
steps:
# install the additional keys needed to push to GitHub. Alex Collins owns these keys.
- add_ssh_keys
- run: git config --global user.email "nobody@circleci.com"
- run: git config --global user.name "Circle CI Build"
- checkout
- run: helm repo add stable https://charts.helm.sh/stable
- run: helm repo add minio https://helm.min.io/
- run: helm repo add argo https://argoproj.github.io/argo-helm
- run: helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
# Only actually publish charts on master.
- run: |
set -x
if [ "$CIRCLE_BRANCH" = "master" ]; then
export GIT_PUSH=true
else
export GIT_PUSH=false
fi
sh ./scripts/publish.sh
- run: echo "Replaced by Github Workflow - https://github.com/argoproj/argo-helm/actions/workflows/publish.yml"

workflows:
version: 2
workflow:
Expand Down
2 changes: 2 additions & 0 deletions .github/configs/cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Reference: https://github.com/helm/chart-releaser
index-path: "./index.yaml"
19 changes: 19 additions & 0 deletions .github/configs/ct-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md
# Don't add the 'debug' attribute, otherwise the workflow won't work anymore
# Only Used for the CT Install Stage
remote: origin
chart-dirs:
- charts
chart-repos:
- argo=https://argoproj.github.io/argo-helm
- minio=https://helm.min.io/
- dandydeveloper=https://dandydeveloper.github.io/charts/
- stable=https://charts.helm.sh/stable
- incubator=https://charts.helm.sh/incubator
helm-extra-args: "--timeout 600s"
validate-chart-schema: false
validate-maintainers: true
validate-yaml: true
exclude-deprecated: true
excluded-charts:
- "argocd-applicationset"
1 change: 1 addition & 0 deletions .github/ct.yaml → .github/configs/ct-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md
# Don't add the 'debug' attribute, otherwise the workflow won't work anymore
# Only Used for the CT Lint Stage
remote: origin
chart-dirs:
- charts
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ jobs:
id: list-changed
run: |
## If executed with debug this won't work anymore.
changed=$(ct --config ./.github/ct.yaml list-changed)
changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed)
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "::set-output name=changed_charts::$charts"
fi
- name: Run chart-testing (lint)
run: ct lint --debug --config ./.github/ct.yaml --lint-conf ./.github/lintconf.yaml
run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.1.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install --config ./.github/ct.yaml
run: ct install --config ./.github/configs/ct-install.yaml
if: steps.list-changed.outputs.changed == 'true'
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Chart Publish
on:
push:
branches:
- master
- rewrite-build
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v1

- name: Add dependency chart repos
run: |
helm repo add argo https://argoproj.github.io/argo-helm
helm repo add minio https://helm.min.io/
helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
helm repo add stable https://charts.helm.sh/stable
helm repo add incubator https://charts.helm.sh/incubator
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
## This is required to consider the old Circle-CI Index and to stay compatible with all the old releases.
- name: Fetch current Chart Index
run: |
git checkout origin/gh-pages index.yaml
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
with:
config: "./.github/configs/cr.yaml"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
11 changes: 2 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ As part of the Continuous Integration system we run Helm's [Chart Testing](https

The checks for this tool are stricter than the standard Helm requirements, where fields normally considered optional like `maintainer` are required in the standard spec and must be valid GitHub usernames.

Linting configuration can be found in [lintconf.yaml](.circleci/lintconf.yaml)
Linting configuration can be found in [ct-lint.yaml](./.github/configs/ct-lint.yaml)

The linting can be invoked manually with the following command:

Expand All @@ -96,11 +96,4 @@ The linting can be invoked manually with the following command:

## Publishing Changes

Changes are automatically publish whenever a commit is merged to master. The CI job (see `.circleci/config.yaml`) runs this:

```
GIT_PUSH=true ./scripts/publish.sh
```

Script generates tar file for each chart in `charts` directory and push changes to `gh-pages` branch.
Write access to https://github.com/argoproj/argo-helm.git is required to publish changes.
Changes are automatically publish whenever a commit is merged to master. The CI job (see `./.github/workflows/publish.yml`).
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Argo Helm Charts

[![Chart Publish](https://github.com/argoproj/argo-helm/actions/workflows/publish.yml/badge.svg?branch=master)](https://github.com/argoproj/argo-helm/actions/workflows/publish.yml)

Argo Helm is a collection of **community maintained** charts for http://argoproj.io/ projects. The charts can be added using following command:

```
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-cd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 2.0.1
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 3.4.0
version: 3.4.1
home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-events/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart to install Argo-Events in k8s Cluster
name: argo-events
version: 1.4.1
version: 1.4.2
keywords:
- argo-events
- sensor-controller
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-rollouts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.10.2"
description: A Helm chart for Argo Rollouts
name: argo-rollouts
version: 0.5.2
version: 0.5.3
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
home: https://github.com/argoproj/argo-helm
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-workflows/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: argo-workflows
description: A Helm chart for Argo Workflows
type: application
version: 0.1.0
version: 0.1.1
appVersion: "v3.0.2"
icon: https://raw.githubusercontent.com/argoproj/argo-workflows/master/docs/assets/argo.png
home: https://github.com/argoproj/argo-helm
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-workflows/ci/enable-metrics-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
controller:
serviceMonitor:
enabled: true
enabled: false
metricsConfig:
enabled: true
telemetryConfig:
Expand Down
2 changes: 1 addition & 1 deletion charts/argocd-applicationset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-applicationset
description: A Helm chart for installing ArgoCD ApplicationSet
type: application
version: 0.1.4
version: 0.1.5
appVersion: "v0.1.0"
home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
Expand Down
2 changes: 1 addition & 1 deletion charts/argocd-notifications/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 1.1.1
description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD.
name: argocd-notifications
type: application
version: 1.3.0
version: 1.3.1
home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
keywords:
Expand Down
4 changes: 2 additions & 2 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ docker run \
quay.io/helmpack/chart-testing:v3.3.1 \
-c cd /workdir \
ct lint \
--config .github/ct.yaml \
--lint-conf .github/lintconf.yaml \
--config .github/configs/ct-lint.yaml \
--lint-conf .github/configs/lintconf.yaml \
--debug
42 changes: 0 additions & 42 deletions scripts/publish.sh

This file was deleted.

0 comments on commit 9a3077a

Please sign in to comment.