-
Notifications
You must be signed in to change notification settings - Fork 193
112 lines (98 loc) · 3.62 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
name: RELEASE-CHART
on:
workflow_dispatch:
inputs:
chart_version:
description: 'The version of helm chart'
required: true
default: ''
release:
types:
- published
env:
GH_TOKEN: ${{ github.token }}
RELEASE_VERSION: ${{ github.ref_name }}
RELEASE_BOT_WEBHOOK: ${{ secrets.RELEASE_BOT_WEBHOOK }}
jobs:
chart-version:
runs-on: ubuntu-latest
outputs:
chart-version: ${{ steps.get_version.outputs.chart_version }}
chart-version-bump: ${{ steps.get_version.outputs.chart_version_bump }}
steps:
- name: Get Chart Version
id: get_version
run: |
VERSION=${{ inputs.chart_version }}
if [ -z "$VERSION" ]; then
VERSION=${{ env.RELEASE_VERSION }}
fi
echo chart_version=$VERSION >> $GITHUB_OUTPUT
VERSION_BUMP="${VERSION/v/}"
echo chart_version_bump=$VERSION_BUMP >> $GITHUB_OUTPUT
release-chart:
needs: chart-version
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
MAKE_OPS: "bump-chart-ver"
VERSION: "${{ needs.chart-version.outputs.chart-version }}"
CHART_NAME: "kubeblocks"
CHART_DIR: "deploy/helm"
DEP_CHART_DIR: "deploy/helm/depend-charts"
APECD_REF: "v0.1.37"
secrets: inherit
release-addons-chart:
needs: chart-version
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
GITHUB_REPO: "apecloud/kubeblocks-addons"
VERSION: "${{ needs.chart-version.outputs.chart-version }}"
CHART_DIR: "addons"
APECD_REF: "v0.1.37"
secrets: inherit
release-charts-image:
needs: [ chart-version, release-chart, release-addons-chart ]
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
MAKE_OPS_PRE: "helm-package VERSION=${{ needs.chart-version.outputs.chart-version-bump }}"
IMG: "apecloud/kubeblocks-charts"
VERSION: "${{ needs.chart-version.outputs.chart-version }}"
GO_VERSION: "1.21"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile-charts"
secrets: inherit
send-message:
runs-on: ubuntu-latest
needs: release-charts-image
if: ${{ always() && github.event.action == 'published' }}
steps:
- uses: actions/checkout@v4
- name: send message
id: send_message
run: |
release_result="${{ env.RELEASE_VERSION }}-chart"
touch ${release_result}
echo 'release-result='${release_result} >> $GITHUB_OUTPUT
CONTENT="release\u00a0${{ env.RELEASE_VERSION }}\u00a0chart\u00a0error"
if [[ "${{ needs.release-charts-image.result }}" == "success" ]]; then
CONTENT="release\u00a0${{ env.RELEASE_VERSION }}\u00a0chart\u00a0success"
echo "success" > ${release_result}
else
echo "error" > ${release_result}
fi
bash .github/utils/utils.sh --type 12 \
--tag-name ${{ env.RELEASE_VERSION }} \
--content "${CONTENT}"\
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- name: delete cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.send_message.outputs.release-result }}"
- name: Save Artifact
id: cache-artifact-save
uses: actions/cache/save@v3
with:
path: |
${{ steps.send_message.outputs.release-result }}
key: ${{ steps.send_message.outputs.release-result }}