Skip to content

Merge pull request #8 from Knapsack44/feat/add-auth-method #57

Merge pull request #8 from Knapsack44/feat/add-auth-method

Merge pull request #8 from Knapsack44/feat/add-auth-method #57

name: Release Kratix Chart
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- 'kratix/**'
env:
GITHUB_TOKEN: "${{ secrets.CR_TOKEN }}"
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "syntassodev"
git config user.email "kratix@syntasso.io"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Delete existing release/tag
run: |
gh release delete kratix-v0.0.1 -y --cleanup-tag || true
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
install_only: true
- name: Package Chart
run: |
cr package kratix/
- name: Upload Package
run: |
cr upload --owner syntasso --git-repo helm-charts --token $GITHUB_TOKEN --push
- name: Update Index
run: |
git checkout gh-pages
export package_digest=$(shasum -a 256 .cr-release-packages/kratix-v0.0.1.tgz | awk '{print $1}')
current_digest=$(yq -r '.entries.kratix[0].digest' index.yaml)
if [ "$package_digest" = "$current_digest" ]; then
echo "No new changes detected"
exit 0
fi
export current_date=$(date -u +"%Y-%m-%dT%T.%NZ")
yq -i '.entries.kratix[0].digest = env(package_digest) | .entries.kratix[0].created = strenv(current_date) ' index.yaml
git add index.yaml
git commit -m "Update index.yaml"
git push