-
Notifications
You must be signed in to change notification settings - Fork 64
90 lines (82 loc) · 3.06 KB
/
manual-release-charts.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Manual event to release helm chart to public site on release branch
on:
workflow_dispatch:
inputs:
version:
default: "0-latest"
description: "Release Version"
required: true
type: string
# artifacthub:
# default: false
# description: "Release to ArtifactHub repo"
# required: true
# type: bool
ghcr:
default: true
description: "Release to ghcr"
required: true
type: bool
jobs:
release-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Prepare helm packages
env:
SRC_DIR: helm-charts
DEST_DIR: charts
run: |
if grep -r '^version: ' `find helm-charts/ -name "Chart.yaml"` | grep -v "${{ inputs.version }}"; then
echo "Version check failed"
exit 1
fi
mkdir -p ${DEST_DIR}
# git clone --branch charts-release https://github.com/opea-project/GenAIInfra.git charts
# update components
for chart in ${SRC_DIR}/common/*
do
echo "Packaging chart $chart..."
helm dependency update ${chart}
helm package $chart --destination ${DEST_DIR}
done
# update E2E Applications
for chart in ${SRC_DIR}/*
do
if [ -f $chart ]; then continue; fi
if [[ $chart =~ "common" ]]; then continue; fi
echo "Packaging chart $chart..."
helm dependency update ${chart}
helm package $chart --destination ${DEST_DIR}
done
- name: Publish helm charts
run: |
set -x
cd charts
# if [ "${{ inputs.artifacthub }}" = "true" ]; then
# echo "Push ${{ inputs.version }} charts to charts-release branch"
# helm repo index .
# # Insert copyright to avoid warnings
# sed -i '1s/^/# Copyright (C) 2024 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\n/' index.yaml
# git config --global user.name "CICD-at-OPEA"
# git config --global user.email "CICD@opea.dev"
# git remote set-url origin https://CICD-at-OPEA:"${{ secrets.ACTION_TOKEN }}"@github.com/opea-project/GenAIInfra.git
# git status
# git add .
# git commit -s -m "Add release ${{ inputs.version }} helm charts"
# git push
# fi
if [ "${{ inputs.ghcr }}" = "true" ]; then
echo "Publish charts version ${{ inputs.version }}to ghcr"
echo "${{ secrets.ACTION_TOKEN }}" | helm registry login ghcr.io -u test --password-stdin
for chart in *-${{ inputs.version }}.tgz; do
echo "Publishing ${chart}"
helm push ${chart} oci://ghcr.io/opea-project/charts
done
fi