Skip to content

Commit

Permalink
Add github action for helm chart release and verify (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>
  • Loading branch information
chandankumar4 authored May 29, 2024
1 parent 5cc34bf commit 9b54d2a
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 13 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on:
pull_request:
push:
branches:
- main

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

- name: "Step 2: Set up Helm"
uses: azure/setup-helm@v4.2.0
with:
version: v3.14.4

- name: "Step 3: Setup puthon"
uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true

- name: "Step 4: Set up chart-testing"
uses: helm/chart-testing-action@v2.6.1

- name: "Step 5: Run chart-testing (list-changed)"
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: "Step 6: Run lint"
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

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

- name: "Step 7: Run chart install"
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

release:
if: github.ref == 'refs/heads/main'
needs:
- lint-test
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: "Step 1: Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: "Step 2: Install Helm"
uses: azure/setup-helm@v4

- name: "Step 3: Run chart-releaser"
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: charts
skip_existing: true
pages_branch: gh-pages
env:
CR_TOKEN: "${{ secrets.ACCESS_TOKEN }}"
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SHELL:=/bin/bash

# Latest version of Numaflow
NUMAFLOW_VERSION=v1.2.1

# Update the numaflow CRDs
.PHONY: update-crds
update-crds:
NUMAFLOW_VERSION=${NUMAFLOW_VERSION} ./scripts/numaflow-release.sh
4 changes: 3 additions & 1 deletion charts/numaflow/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.2
version: 0.0.3
maintainers:
- name: chandankumar4
12 changes: 0 additions & 12 deletions charts/numaflow/RELEASES.md

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/numaflow-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Download numaflow CRDs
wget -O charts/numaflow/crds/isbsvcs.yaml https://raw.githubusercontent.com/numaproj/numaflow/${NUMAFLOW_VERSION}/config/base/crds/full/numaflow.numaproj.io_interstepbufferservices.yaml
wget -O charts/numaflow/crds/pipelines.yaml https://raw.githubusercontent.com/numaproj/numaflow/${NUMAFLOW_VERSION}/config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
wget -O charts/numaflow/crds/vertices.yaml https://raw.githubusercontent.com/numaproj/numaflow/${NUMAFLOW_VERSION}/config/base/crds/full/numaflow.numaproj.io_vertices.yaml

0 comments on commit 9b54d2a

Please sign in to comment.