-
Notifications
You must be signed in to change notification settings - Fork 176
223 lines (205 loc) · 7.43 KB
/
release-helm-chart.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: Release Charts
on:
workflow_dispatch:
inputs:
release_version:
description: 'The release version of helm chart'
required: true
default: ''
release:
types:
- published
env:
GH_TOKEN: ${{ github.token }}
RELEASE_VERSION: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
jobs:
release-version:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.get_release_version.outputs.release_version }}
release-version-bump: ${{ steps.get_release_version.outputs.release_version_bump }}
steps:
- name: Get Release Version
id: get_release_version
run: |
RELEASE_VERSION=${{ inputs.release_version }}
if [ -z "$RELEASE_VERSION" ]; then
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
fi
echo release_version=$RELEASE_VERSION >> $GITHUB_OUTPUT
RELEASE_VERSION_BUMP="${RELEASE_VERSION/v/}"
echo release_version_bump=$RELEASE_VERSION_BUMP >> $GITHUB_OUTPUT
release-chart:
needs: [ release-version ]
uses: apecloud/apecloud-cd/.github/workflows/release-charts.yml@v0.1.62
with:
MAKE_OPS: "bump-chart-ver"
VERSION: "${{ needs.release-version.outputs.release-version }}"
CHART_NAME: "kubeblocks"
CHART_DIR: "deploy/helm"
APECD_REF: "v0.1.62"
MAKE_OPS_POST: "install"
GO_VERSION: "1.21"
secrets: inherit
release-addons-chart:
needs: [ release-chart ]
uses: apecloud/apecloud-cd/.github/workflows/release-charts.yml@v0.1.68
with:
GITHUB_REPO: "apecloud/kubeblocks-addons"
GITHUB_REF: ${{ github.ref }}
CHART_DIR: "addons"
APECD_REF: "v0.1.68"
ENABLE_JIHU: false
secrets: inherit
release-addons-cluster-chart:
needs: [ release-chart ]
uses: apecloud/apecloud-cd/.github/workflows/trigger-workflow.yml@v0.1.62
with:
GITHUB_REPO: "apecloud/kubeblocks-addons"
BRANCH_NAME: "${{ github.ref_name }}"
WORKFLOW_ID: "release-addons-cluster-chart.yml"
APECD_REF: "v0.1.62"
secrets: inherit
release-charts-image:
needs: [ release-version, release-addons-chart ]
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.24
with:
MAKE_OPS_PRE: "helm-package VERSION=${{ needs.release-version.outputs.release-version-bump }}"
IMG: "apecloud/kubeblocks-charts"
VERSION: "${{ needs.release-version.outputs.release-version }}"
GO_VERSION: "1.21"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile-charts"
secrets: inherit
release-message:
runs-on: ubuntu-latest
needs: [ release-charts-image ]
outputs:
content-result: ${{ steps.release_message.outputs.content_result }}
release-version: ${{ steps.release_message.outputs.release_version }}
if: ${{ always() && github.event.action == 'published' }}
steps:
- uses: actions/checkout@v4
- name: release message
id: release_message
run: |
ARTIFACT_KEY="${{ env.RELEASE_VERSION }}-chart"
touch ${ARTIFACT_KEY}
echo 'artifact_key='${ARTIFACT_KEY} >> $GITHUB_OUTPUT
CONTENT="error"
if [[ "${{ needs.release-charts-image.result }}" == "success" ]]; then
CONTENT="success"
echo "success" > ${ARTIFACT_KEY}
else
echo "error" > ${ARTIFACT_KEY}
fi
echo 'content_result='$CONTENT >> $GITHUB_OUTPUT
echo release_version=${{ env.RELEASE_VERSION }} >> $GITHUB_OUTPUT
- name: delete cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.release_message.outputs.artifact_key }}"
- name: Save Artifact
id: cache-artifact-save
uses: actions/cache/save@v3
with:
path: |
${{ steps.release_message.outputs.artifact_key }}
key: ${{ steps.release_message.outputs.artifact_key }}
send-message:
needs: [ release-message ]
if: ${{ always() && github.event.action == 'published' }}
uses: apecloud/apecloud-cd/.github/workflows/feishui-message.yml@v0.1.38
with:
TYPE: "2"
CONTENT: "release chart ${{ needs.release-message.outputs.release-version }} ${{ needs.release-message.outputs.content-result }}"
APECD_REF: "v0.1.38"
secrets: inherit
get-addons-chart-dir:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get_addons_chart_dir.outputs.matrix }}
steps:
- name: Checkout kubeblocks-addons Code
uses: actions/checkout@v4
with:
repository: apecloud/kubeblocks-addons
path: kubeblocks-addons
ref: ${{ github.ref }}
- name: get addons chart dir
id: get_addons_chart_dir
run: |
addons_list=$(ls kubeblocks-addons/addons)
ADDONS_DIR=""
for addons_name in $( echo "$addons_list" ); do
if [[ -z "$ADDONS_DIR" ]]; then
ADDONS_DIR="{\"addon-name\":\"$addons_name\"}"
else
ADDONS_DIR="$ADDONS_DIR,{\"addon-name\":\"$addons_name\"}"
fi
done
echo "$ADDONS_DIR"
echo "matrix={\"include\":[$ADDONS_DIR]}" >> $GITHUB_OUTPUT
release-addons-chart-jihu:
needs: [ get-addons-chart-dir ]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.get-addons-chart-dir.outputs.matrix) }}
uses: apecloud/apecloud-cd/.github/workflows/release-charts-jihu.yml@v0.1.52
with:
GITHUB_REPO: "apecloud/kubeblocks-addons"
GITHUB_REF: ${{ github.ref }}
CHART_DIR: "addons"
SPECIFY_CHART: "${{ matrix.addon-name }}"
APECD_REF: "v0.1.52"
secrets: inherit
release-addons-chart-ent:
needs: [ release-addons-chart ]
uses: apecloud/apecloud-cd/.github/workflows/release-charts-enterprise.yml@v0.1.53
with:
GITHUB_REPO: "apecloud/apecloud-addons"
GITHUB_REF: ${{ github.ref }}
CHART_DIR: "addons"
APECD_REF: "v0.1.53"
ENABLE_JIHU: false
secrets: inherit
get-addons-chart-dir-ent:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get_addons_chart_dir.outputs.matrix }}
steps:
- name: Checkout apecloud-addons Code
uses: actions/checkout@v4
with:
repository: apecloud/apecloud-addons
path: apecloud-addons
ref: ${{ github.ref }}
token: ${{ env.GITHUB_TOKEN }}
- name: get addons chart dir
id: get_addons_chart_dir
run: |
addons_list=$(ls apecloud-addons/addons)
ADDONS_DIR=""
for addons_name in $( echo "$addons_list" ); do
if [[ -z "$ADDONS_DIR" ]]; then
ADDONS_DIR="{\"addon-name\":\"$addons_name\"}"
else
ADDONS_DIR="$ADDONS_DIR,{\"addon-name\":\"$addons_name\"}"
fi
done
echo "$ADDONS_DIR"
echo "matrix={\"include\":[$ADDONS_DIR]}" >> $GITHUB_OUTPUT
release-addons-chart-jihu-ent:
needs: [ get-addons-chart-dir-ent ]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.get-addons-chart-dir-ent.outputs.matrix) }}
uses: apecloud/apecloud-cd/.github/workflows/release-charts-jihu-enterprise.yml@v0.1.53
with:
GITHUB_REPO: "apecloud/apecloud-addons"
GITHUB_REF: ${{ github.ref }}
CHART_DIR: "addons"
SPECIFY_CHART: "${{ matrix.addon-name }}"
APECD_REF: "v0.1.53"
secrets: inherit