-
Notifications
You must be signed in to change notification settings - Fork 14
104 lines (90 loc) · 3.1 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
name: RELEASE-VERSION
on:
workflow_dispatch:
inputs:
release_version:
description: 'The tag name of release'
required: true
default: ''
run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.release_version }}
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
RELEASE_BOT_WEBHOOK: ${{ secrets.RELEASE_BOT_WEBHOOK }}
jobs:
merge-releasing-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Auto merge releasing PR
run: ./.github/utils/merge_releasing_pr.sh
release-message:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get_trigger_mode.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: release message
id: get_trigger_mode
run: |
bash .github/utils/utils.sh --type 11 \
--tag-name "${{ inputs.release_version }}" \
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }}
TEST_PACKAGES=`bash .github/utils/utils.sh --type 16 \
--trigger-type "[test]" \
--test-pkgs "internal|apis|controllers|cmd" \
--test-check "mod-vendor|lint"`
echo "matrix={\"include\":[$TEST_PACKAGES]}" >> $GITHUB_OUTPUT
release-test:
needs: release-message
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix: ${{ fromJSON(needs.release-message.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- 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.51.2
- name: make test ${{ matrix.ops }}
run: |
make ${{ matrix.ops }}
- name: make ${{ matrix.ops }}
if: ${{ contains(matrix.ops, '/') }}
run: |
make test TEST_PACKAGES=./${{ matrix.ops }}/...
release-version:
needs: release-test
runs-on: ubuntu-latest
steps:
- name: checkout branch ${{ github.ref_name }}
uses: actions/checkout@v3
- name: push tag
uses: mathieudutour/[email protected]
with:
custom_tag: ${{ inputs.release_version }}
github_token: ${{ env.GITHUB_TOKEN }}
tag_prefix: ""
send-message:
runs-on: ubuntu-latest
needs: release-version
if: ${{ failure() || cancelled() }}
steps:
- uses: actions/checkout@v3
- name: send message
run: |
bash .github/utils/utils.sh --type 12 \
--tag-name ${{ inputs.release_version }} \
--content "release\u00a0${{ inputs.release_version }}\u00a0error"\
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"