Skip to content

Commit

Permalink
WiP: untable Helm charts...
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Feb 14, 2024
1 parent 3b9fbf9 commit b819115
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/package-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ on:
push:
tags:
- "v*.*.*"
branches:
- main

env:
CHARTS_DIR: deployment/helm/
IS_RELEASE: ${{ github.ref == 'refs/heads/main' && 'false' || 'true' }}

jobs:
release:
if: ${{ startWith(github.ref, 'refs/tags/v' }}
permissions:
contents: write
runs-on: ubuntu-latest
Expand All @@ -20,7 +24,7 @@ jobs:
- name: Install Helm
uses: azure/[email protected]

- name: Package Helm charts
- name: Package Release Helm Charts
run: |
find "$CHARTS_DIR" -name values.yaml | xargs -I '{}' \
sed -e s"/pullPolicy:.*/pullPolicy: IfNotPresent/" -i '{}'
Expand All @@ -30,10 +34,38 @@ jobs:
mv $SRC_FILE $DEST_FILE
done
- name: Upload Helm packages to GitHub releases
- name: Upload Release Helm Chart Packages to GitHub Release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
draft: true
append_body: true
files: nri-*helm-chart*.tgz

unstable:
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Deep Checkout
uses: actions/checkout@v4
fetch-depth: 0

- name: Install Helm
uses: azure/[email protected]

- name: Package Unstable Helm Charts
run: |
majminpatch="$(git describe | sed -E 's/(v[0-9]*\.[0-9]*\.[0-9]*).*$/\1/')"
majmin=${majminpatch%.*}
patch=${majminpatch##*.}
CHART_VERSION="${majmin}.$((patch+1))-unstable"
APP_VERSION=unstable
find "$CHARTS_DIR" -name values.yaml | xargs -I '{}' \
sed -e s"/pullPolicy:.*/pullPolicy: IfNotPresent/" -i '{}'
helm package --version "$CHART_VERSION" --app-version $APP_VERSION "$CHARTS_DIR"/*
find . -name '*.tgz' -print | while read SRC_FILE; do
DEST_FILE=$(echo $SRC_FILE | sed 's/v/helm-chart-v/g')
mv -v $SRC_FILE $DEST_FILE
done

0 comments on commit b819115

Please sign in to comment.