Skip to content

Commit cf0d73a

Browse files
authored
chore: release version without prefix v (#740)
* chore: release version without prefix v * chore: fix release version without prefix v
1 parent db0b3ed commit cf0d73a

2 files changed

Lines changed: 31 additions & 52 deletions

File tree

.github/workflows/get-version.yml

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@ on:
2525
default: 'release'
2626
outputs:
2727
release-version:
28-
description: "test result"
28+
description: "release version"
2929
value: ${{ jobs.get-version.outputs.release-version }}
30+
release-version-2:
31+
description: "release version without prefix v"
32+
value: ${{ jobs.get-version.outputs.release-version-2 }}
3033
release-branch:
3134
description: "release branch"
3235
value: ${{ jobs.get-version.outputs.release-branch }}
33-
# kbcli-branch:
34-
# description: "kbcli branch"
35-
# value: ${{ jobs.get-version.outputs.kbcli-branch }}
36-
# kubeblocks-pkg-version:
37-
# description: "kubeblocks pkg version"
38-
# value: ${{ jobs.get-version.outputs.kubeblocks-pkg-version }}
3936

4037
env:
4138
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
@@ -49,9 +46,8 @@ jobs:
4946
runs-on: ubuntu-latest
5047
outputs:
5148
release-version: ${{ steps.get_version.outputs.release-version }}
49+
release-version-2: ${{ steps.get_version.outputs.release-version-2 }}
5250
release-branch: ${{ steps.get_branch.outputs.release-branch }}
53-
# kbcli-branch: ${{ steps.get_kbcli_branch.outputs.kbcli-branch }}
54-
# kubeblocks-pkg-version: ${{ steps.get_kubeblocks_version.outputs.kubeblocks-pkg-version }}
5551
steps:
5652
- name: Checkout apecloud-cd Code
5753
uses: actions/checkout@v4
@@ -101,38 +97,14 @@ jobs:
10197
echo "$cmd"
10298
RELEASE_VERSION=$(eval "$cmd")
10399
echo release-version=$RELEASE_VERSION >> $GITHUB_OUTPUT
100+
101+
RELEASE_VERSION_2="${RELEASE_VERSION}"
102+
if [[ "${RELEASE_VERSION_2}" == "v"* ]]; then
103+
RELEASE_VERSION_2="${RELEASE_VERSION_2/v/}"
104+
fi
105+
echo release-version-2=${RELEASE_VERSION_2} >> $GITHUB_OUTPUT
106+
107+
104108
if [[ -z "${RELEASE_VERSION}" || "${RELEASE_VERSION}" == *"code"*"data"*"msg"* ]]; then
105109
exit 1
106110
fi
107-
108-
# - name: Checkout apecloud-cd Code
109-
# if: ${{ github.repository == 'apecloud/apecloud' && contains(inputs.CONTENT, 'kbcli') }}
110-
# uses: actions/checkout@v4
111-
# with:
112-
# repository: apecloud/apecloud-cd
113-
# path: apecloud-cd
114-
# ref: ${{ inputs.APECD_REF }}
115-
#
116-
# - name: get kbcli branch
117-
# if: ${{ github.repository == 'apecloud/apecloud' && contains(inputs.CONTENT, 'kbcli') }}
118-
# id: get_kbcli_branch
119-
# run: |
120-
# cmd="bash apecloud-cd/.github/utils/webhook_utils.sh --type 4 --content '${{ inputs.CONTENT }}' "
121-
# echo "$cmd"
122-
# KBCLI_BRANCH=$(eval "$cmd")
123-
# echo kbcli-branch=$KBCLI_BRANCH >> $GITHUB_OUTPUT
124-
#
125-
# - name: Checkout kbcli Code
126-
# if: ${{ github.repository == 'apecloud/apecloud' && contains(inputs.CONTENT, 'kbcli') }}
127-
# uses: actions/checkout@v4
128-
# with:
129-
# repository: apecloud/kbcli
130-
# path: kbcli
131-
# ref: ${{ steps.get_kbcli_branch.outputs.kbcli-branch }}
132-
#
133-
# - name: get kbcli gomod kubeblocks pkg version
134-
# if: ${{ github.repository == 'apecloud/apecloud' && contains(inputs.CONTENT, 'kbcli') }}
135-
# id: get_kubeblocks_version
136-
# run: |
137-
# KUBEBLOCKS_PKG_VERSION=$(cat kbcli/go.mod | grep "github.com/apecloud/kubeblocks" | awk 'NR==1{print $2}')
138-
# echo kubeblocks-pkg-version=$KUBEBLOCKS_PKG_VERSION >> $GITHUB_OUTPUT

.github/workflows/release-version.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ on:
4242
release-version:
4343
description: "release version"
4444
value: "${{ jobs.get-version.outputs.release-version }}"
45+
release-version-2:
46+
description: "release version without prefix v"
47+
value: "${{ jobs.get-version.outputs.release-version-2 }}"
4548
release-branch:
4649
description: "release branch"
4750
value: "${{ jobs.get-version.outputs.release-branch }}"
@@ -122,17 +125,21 @@ jobs:
122125
APECD_REF: "${{ inputs.APECD_REF }}"
123126
secrets: inherit
124127

125-
# release-kbcli-cloud-tag:
126-
# needs: [ get-version ]
127-
# if: ${{ github.repository == 'apecloud/apecloud' && contains(inputs.CONTENT, 'kbcli') }}
128-
# uses: ./.github/workflows/trigger-workflow.yml
129-
# with:
130-
# VERSION: "${{ needs.get-version.outputs.release-version }}-cloud"
131-
# APECD_REF: ${{ inputs.APECD_REF }}
132-
# GITHUB_REPO: "apecloud/kbcli"
133-
# BRANCH_NAME: "${{ needs.get-version.outputs.kbcli-branch }}"
134-
# WORKFLOW_ID: "release-tag.yaml"
135-
# secrets: inherit
128+
release-kb-cloud-client-go-version:
129+
needs: [ get-version ]
130+
if: |
131+
!contains(needs.get-version.outputs.release-version, 'alpha') &&
132+
!contains(needs.get-version.outputs.release-version, 'beta') &&
133+
!contains(needs.get-version.outputs.release-version, 'rc')
134+
name: release kb-cloud-client-go version
135+
uses: ./.github/workflows/trigger-workflow.yml
136+
with:
137+
GITHUB_REPO: "apecloud/kb-cloud-client-go"
138+
VERSION: "${{ needs.get-version.outputs.release-version }}"
139+
BRANCH_NAME: "${{ needs.get-version.outputs.release-branch }}"
140+
WORKFLOW_ID: "release-version.yml"
141+
APECD_REF: "${{ inputs.APECD_REF }}"
142+
secrets: inherit
136143

137144
release-message:
138145
if: ${{ needs.get-version.result == 'success' }}

0 commit comments

Comments
 (0)