-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathoperator-driver-version-update.yaml
More file actions
130 lines (114 loc) · 5.59 KB
/
operator-driver-version-update.yaml
File metadata and controls
130 lines (114 loc) · 5.59 KB
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
# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Reusable workflow to perform operator version update
# To perform csm-operator driver version update, needs two arguments as input to the workflow
name: CSM Operator Driver Version Update
on:
workflow_call:
inputs:
csm-version:
description: "CSM program version, ex: v1.14.0, v1.15.0, ..."
required: true
type: string
update-option:
description: 'Select the update flag, ex. "nightly" or "tag"'
required: true
type: string
jobs:
driver-version-update:
runs-on: ubuntu-latest
steps:
- name: Checkout csm repository
uses: actions/checkout@v6
with:
repository: dell/csm
path: csm
- name: Read values from csm-versions.yaml
id: read_values
run: |
extract_value() {
grep -E "^$1" csm/config/csm-versions.yaml | cut -d ':' -f 2 | tr -d '[:space:]'
}
remove_v_prefix() {
local version="$1"
version="${version#v}"
echo "$version"
}
csm_version=$(extract_value 'csm-version')
csi_powerscale=$(extract_value 'csi-powerscale')
csi_powerstore=$(extract_value 'csi-powerstore')
csi_powermax=$(extract_value 'csi-powermax')
csi_vxflexos=$(extract_value 'csi-vxflexos')
csi_unity=$(extract_value 'csi-unity')
csi_powerscale=$(echo "$csi_powerscale" | grep -oP '(?<=^v).*|^[^v].*')
csi_powerstore=$(echo "$csi_powerstore" | grep -oP '(?<=^v).*|^[^v].*')
csi_powermax=$(echo "$csi_powermax" | grep -oP '(?<=^v).*|^[^v].*')
csi_vxflexos=$(echo "$csi_vxflexos" | grep -oP '(?<=^v).*|^[^v].*')
csi_unity=$(echo "$csi_unity" | grep -oP '(?<=^v).*|^[^v].*')
echo "CSM_VERSION=$csm_version" >> $GITHUB_ENV
echo "CSI_POWERSCALE=$csi_powerscale" >> $GITHUB_ENV
echo "CSI_POWERSTORE=$csi_powerstore" >> $GITHUB_ENV
echo "CSI_POWERMAX=$csi_powermax" >> $GITHUB_ENV
echo "CSI_VXFLEXOS=$csi_vxflexos" >> $GITHUB_ENV
echo "CSI_UNITY=$csi_unity" >> $GITHUB_ENV
- name: Checkout csm-operator repository
uses: actions/checkout@v6
with:
repository: dell/csm-operator
- name: Set Up Go Environment
uses: actions/setup-go@v6
- name: Install yq
run: |
go install github.com/mikefarah/yq/v4@latest
- name: Updating Driver version
working-directory: ${{ github.workspace }}
shell: bash
run: |
echo "Input csm version --> ${{ inputs.csm-version }}"
echo "Update flag --> ${{ inputs.update-option }}"
csm_ver_provided=${{ inputs.csm-version }}
csm_repo_ver="$(echo -e "${CSM_VERSION}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
csm_ver_provided="$(echo -e "${csm_ver_provided}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
echo "./.github/scripts/driver-version-update.sh --driver_update_type \"major\" --release_type \"${{ inputs.update-option }}\" --powerscale_version \"$CSI_POWERSCALE\" --powermax_version \"$CSI_POWERMAX\" --powerflex_version \"$CSI_VXFLEXOS\" --powerstore_version \"$CSI_POWERSTORE\" --unity_version \"$CSI_UNITY\""
if [ $csm_repo_ver == $csm_ver_provided ]; then
echo "CSM version verified, proceeding with the update..."
chmod +x ./.github/scripts/driver-version-update.sh
bash ./.github/scripts/driver-version-update.sh --driver_update_type "major" --release_type "${{ inputs.update-option }}" --powerscale_version "$CSI_POWERSCALE" --powermax_version "$CSI_POWERMAX" --powerflex_version "$CSI_VXFLEXOS" --powerstore_version "$CSI_POWERSTORE" --unity_version "$CSI_UNITY"
else
echo "CSM version mismatch detected. Please verify and update the version file in the CSM repository."
fi
# Needed for signing commits using Github App tokens
# See: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#commit-signing
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v3.1.1
id: generate-token
with:
app-id: ${{ vars.CSM_RELEASE_APP_ID }}
private-key: ${{ secrets.CSM_RELEASE_APP_PRIVATE_KEY }}
# Must enable "allow GitHub Actions to create pull requests" setting
# Author defaults to the user who triggered the workflow run
- name: Create pull request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ steps.generate-token.outputs.token }}
branch: "operator-driver-ver-bumpup-${{ inputs.csm-version }}"
commit-message: "Update operator driver version for csm-${{ inputs.csm-version }}"
title: "Update operator driver version to csm-${{ inputs.csm-version }}"
body: |
Driver version updated to latest in yaml files for following drivers:-
- Powerscale
- Powermax
- Powerflex
- Powerstore
- Unity
Note:-
Ensured consistency and accuracy in documentation files
Update the driver version in the .go files.
Auto-generated by [common-github-actions](https://github.com/dell/common-github-actions)
sign-commits: true
delete-branch: true