Skip to content

Commit 70e286a

Browse files
authored
Added support for n-x release (#304)
1 parent b11ffde commit 70e286a

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/release.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,40 @@ on: # yamllint disable-line rule:truthy
1414
- major
1515
- minor
1616
- patch
17+
- n-1/n-2 patch (Provide input in the below box)
18+
version:
19+
description: "Patch version to release. example: 2.1.x (Use this only if n-1/n-2 patch is selected)"
20+
required: false
21+
type: string
1722
jobs:
23+
process-inputs:
24+
name: Process Inputs
25+
runs-on: ubuntu-latest
26+
outputs:
27+
processedVersion: ${{ steps.set-version.outputs.versionEnv }}
28+
steps:
29+
- name: Process input
30+
id: set-version
31+
shell: bash
32+
run: |
33+
if [[ "${{ github.event.inputs.version }}" != "" && "${{ github.event.inputs.option }}" == "n-1/n-2 patch (Provide input in the below box)" ]]; then
34+
# if both version and option are provided, then version takes precedence i.e. patch release for n-1/n-2
35+
echo "versionEnv=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
36+
exit 0
37+
fi
38+
39+
if [[ "${{ github.event.inputs.option }}" != "n-1/n-2 patch (Provide input in the below box)" ]]; then
40+
# if only option is provided, then option takes precedence i.e. minor, major or patch release
41+
echo "versionEnv=${{ github.event.inputs.option }}" >> $GITHUB_OUTPUT
42+
exit 0
43+
fi
44+
# if neither option nor version is provided, then minor release is taken by default (Auto-release)
45+
echo "versionEnv=minor" >> $GITHUB_OUTPUT
1846
csm-release:
47+
needs: [process-inputs]
1948
uses: dell/common-github-actions/.github/workflows/csm-release-driver-module.yaml@main
2049
name: Release CSM Drivers and Modules
2150
with:
22-
version: ${{ github.event.inputs.option }}
51+
version: "${{ needs.process-inputs.outputs.processedVersion }}"
2352
images: 'csi-unity'
2453
secrets: inherit

0 commit comments

Comments
 (0)