Skip to content

Commit ed9c364

Browse files
JashBookapecloud-bot
authored andcommitted
chore: add check release addon version workflow (#9776)
(cherry picked from commit d1488bd)
1 parent 184d1a6 commit ed9c364

File tree

2 files changed

+91
-1
lines changed

2 files changed

+91
-1
lines changed

.github/workflows/release-image.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,37 @@ jobs:
220220
EXTRA_ARGS: "TEST_TYPE=${{ matrix.test-type }}#CLOUD_PROVIDER=${{ vars.CLOUD_PROVIDER }}"
221221
secrets: inherit
222222

223+
release-branch:
224+
needs: [ release-message, release-result ]
225+
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
226+
with:
227+
RELEASE_VERSION: "${{ needs.release-message.outputs.release-version }}"
228+
RELEASE_BRANCH: "default"
229+
APECD_REF: "v0.1.96"
230+
secrets: inherit
231+
232+
update-addons-release-notes:
233+
needs: [ release-message, release-branch ]
234+
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
235+
with:
236+
GITHUB_REPO: "apecloud/kubeblocks-addons"
237+
BRANCH_NAME: "${{ needs.release-branch.outputs.release-branch }}"
238+
WORKFLOW_ID: "update-release-notes.yml"
239+
APECD_REF: "v0.1.96"
240+
VERSION: "${{ needs.release-message.outputs.release-version }}"
241+
secrets: inherit
242+
243+
update-addons-release-notes-ent:
244+
needs: [ release-message, release-branch ]
245+
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
246+
with:
247+
GITHUB_REPO: "apecloud/apecloud-addons"
248+
BRANCH_NAME: "${{ needs.release-branch.outputs.release-branch }}"
249+
WORKFLOW_ID: "update-release-notes.yml"
250+
APECD_REF: "v0.1.96"
251+
VERSION: "${{ needs.release-message.outputs.release-version }}"
252+
secrets: inherit
253+
223254
delete-cache:
224255
needs: e2e-kbcli
225256
runs-on: ubuntu-latest

.github/workflows/release-version.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,67 @@ jobs:
5959
exit 1
6060
fi
6161
62+
release-addons-version-check:
63+
name: ${{ matrix.repo }}-version-check
64+
runs-on: ubuntu-latest
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
repo: [ 'kubeblocks-addons', 'apecloud-addons' ]
69+
outputs:
70+
stable-release: ${{ steps.check_stable_version.outputs.stable-release }}
71+
steps:
72+
- name: check stable version
73+
id: check_stable_version
74+
run: |
75+
RELEASE_VERSION="${{ inputs.release_version }}"
76+
STABLE_RELEASE=0
77+
if [[ "${RELEASE_VERSION}" =~ ^v[0-9]+(\.[0-9]+)*$ ]]; then
78+
STABLE_RELEASE=1
79+
fi
80+
echo stable-release="$STABLE_RELEASE" >> $GITHUB_OUTPUT
81+
82+
- name: checkout ${{ matrix.repo }} ${{ github.ref_name }} code
83+
if: ${{ steps.check_stable_version.outputs.stable-release == '1' }}
84+
uses: actions/checkout@v4
85+
with:
86+
token: ${{ env.GITHUB_TOKEN }}
87+
repository: apecloud/${{ matrix.repo }}
88+
path: ./
89+
ref: ${{ github.ref_name }}
90+
91+
- name: check addon stable versions
92+
if: ${{ steps.check_stable_version.outputs.stable-release == '1' }}
93+
run: |
94+
GIT_BRANCH="${{ github.ref_name }}"
95+
RELEASE_VERSION="${{ inputs.release_version }}"
96+
update_release_notes_script=".github/scripts/update_release_notes.py"
97+
if [[ -f "${update_release_notes_script}" ]]; then
98+
check_file_log="check_addon_stable_versions.log"
99+
touch ${check_file_log}
100+
python3 ${update_release_notes_script} \
101+
--git-branch "${GIT_BRANCH}" \
102+
--git-tag "${RELEASE_VERSION}" \
103+
--dry-run | tee -a ${check_file_log}
104+
NO_STABLE_VERSION=$(cat "${check_file_log}" | (egrep "No stable addon versions found|Pre-release Versions" || true))
105+
if [[ -n "${NO_STABLE_VERSION}" ]]; then
106+
echo "$(tput -T xterm setaf 1)ERROR: No stable addon versions found!$(tput -T xterm sgr0)"
107+
exit 1
108+
fi
109+
fi
110+
111+
send-message-version-check:
112+
needs: [ release-addons-version-check ]
113+
if: ${{ (failure() || cancelled()) && needs.release-addons-version-check.outputs.stable-release == '1' }}
114+
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
115+
with:
116+
TYPE: "2"
117+
CONTENT: "No stable addon versions found, release error"
118+
APECD_REF: "v0.1.96"
119+
secrets: inherit
120+
62121
release-branch:
63-
needs: release-test
122+
needs: [ release-test, release-addons-version-check ]
64123
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
65124
with:
66125
RELEASE_VERSION: "${{ inputs.release_version }}"

0 commit comments

Comments
 (0)