-
Notifications
You must be signed in to change notification settings - Fork 192
132 lines (117 loc) · 4.04 KB
/
release-version.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
name: RELEASE-VERSION
on:
workflow_dispatch:
inputs:
release_version:
description: 'The version of release'
required: true
default: ''
run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.release_version }}
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GO_VERSION: "1.21"
jobs:
release-message:
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
TYPE: "1"
VERSION: "${{ inputs.release_version }}"
APECD_REF: "v0.1.38"
secrets: inherit
trigger-mode:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get_trigger_mode.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: release message
id: get_trigger_mode
run: |
TEST_PACKAGES=`bash .github/utils/utils.sh --type 16 \
--trigger-type "[test]" \
--test-pkgs "${{ vars.TEST_PKGS }}" \
--test-check "${{ vars.TEST_CHECK }}" \
--test-pkgs-first "${{ vars.TEST_PKGS_FIRST }}" \
--ignore-pkgs "${{ vars.SKIP_CHECK_PKG }}"`
echo "matrix={\"include\":[$TEST_PACKAGES]}" >> $GITHUB_OUTPUT
release-test:
needs: [ trigger-mode ]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix: ${{ fromJSON(needs.trigger-mode.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: install lib
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libbtrfs-dev \
libdevmapper-dev
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install golangci-lint
if: matrix.ops == 'lint'
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
- name: make ${{ matrix.ops }}
if: ${{ ! contains(matrix.ops, '/') }}
run: |
make ${{ matrix.ops }}
- name: make test ${{ matrix.ops }}
if: ${{ contains(matrix.ops, '/') }}
run: |
if [[ -d "./${{ matrix.ops }}" ]]; then
make test TEST_PACKAGES=./${{ matrix.ops }}/...
fi
release-branch:
needs: release-test
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
RELEASE_VERSION: "${{ inputs.release_version }}"
RELEASE_BRANCH: "${{ github.ref_name }}"
APECD_REF: "v0.1.38"
secrets: inherit
release-addons-version:
needs: release-branch
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
GITHUB_REPO: "apecloud/kubeblocks-addons"
VERSION: "${{ inputs.release_version }}"
BRANCH_NAME: "${{ needs.release-branch.outputs.release-branch }}"
WORKFLOW_ID: "release-version.yml"
APECD_REF: "v0.1.38"
secrets: inherit
release-kbcli-version:
needs: release-branch
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
GITHUB_REPO: "apecloud/kbcli"
VERSION: "${{ inputs.release_version }}"
BRANCH_NAME: "${{ needs.release-branch.outputs.release-branch }}"
WORKFLOW_ID: "release-version.yml"
APECD_REF: "v0.1.38"
secrets: inherit
release-version:
needs: [ release-addons-version, release-kbcli-version ]
runs-on: ubuntu-latest
steps:
- name: checkout branch ${{ github.ref_name }}
uses: actions/checkout@v4
- name: push tag
uses: mathieudutour/[email protected]
with:
custom_tag: ${{ inputs.release_version }}
github_token: ${{ env.GITHUB_TOKEN }}
tag_prefix: ""
send-message:
needs: [ release-version, release-addons-version, release-kbcli-version ]
if: ${{ failure() || cancelled() }}
uses: apecloud/apecloud-cd/.github/workflows/[email protected]
with:
TYPE: "2"
CONTENT: "release ${{ inputs.release_version }} error"
APECD_REF: "v0.1.38"
secrets: inherit