-
Notifications
You must be signed in to change notification settings - Fork 62
66 lines (61 loc) · 2.21 KB
/
releasedevhelm.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Update the helm charts 0-latest
on:
pull_request_target:
branches:
- main
types: [closed]
paths:
- helm-charts/**
env:
CHARTS_DIR: "helm-charts"
jobs:
run-on-merge:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Get the modified charts list
run: |
echo "This job runs after a PR is merged!"
if grep -r '^version: ' `find helm-charts/ -name "Chart.yaml"` | grep -v "0-latest"; then
echo "Version check failed, only update 0-latest"
exit 1
fi
base_commit=${{ github.event.pull_request.base.sha }}
merged_commit=$(git log -1 --format='%H')
# Update components
common_charts=$(git diff --name-only ${base_commit} ${merged_commit} | \
grep "^$CHARTS_DIR/common" | \
grep -vE 'README.md|*.sh' | \
cut -d'/' -f3 | sort -u )
echo "Charts to be updated: $common_charts"
echo "${{ secrets.ACTION_TOKEN }}" | helm registry login ghcr.io -u opea --password-stdin
pushd $CHARTS_DIR/common
for chart in ${common_charts}; do
echo "Updating $chart"
helm dependency update ${chart}
helm package $chart
helm push ${chart}-0-latest.tgz oci://ghcr.io/opea-project/charts
done
popd
# Update Examples
e2e_charts=$(git diff --name-only ${base_commit} ${merged_commit} | \
grep -v "common" | \
grep -vE 'README.md|*.sh' | \
cut -d'/' -f2 | sort -u )
echo "Charts to be updated: $e2e_charts"
echo "${{ secrets.ACTION_TOKEN }}" | helm registry login ghcr.io -u opea --password-stdin
pushd $CHARTS_DIR
for chart in ${e2e_charts}; do
echo "Updating $chart"
helm dependency update ${chart}
helm package $chart
helm push ${chart}-0-latest.tgz oci://ghcr.io/opea-project/charts
done
popd