From d4f1df7dacf19a1f95e722e0d34fe3e4aa96fbc5 Mon Sep 17 00:00:00 2001 From: KshitijaKakde <111420075+KshitijaKakde@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:31:46 +0530 Subject: [PATCH 1/2] Create create-tag-release.yaml --- .github/workflows/create-tag-release.yaml | 68 +++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/create-tag-release.yaml diff --git a/.github/workflows/create-tag-release.yaml b/.github/workflows/create-tag-release.yaml new file mode 100644 index 00000000..421a798f --- /dev/null +++ b/.github/workflows/create-tag-release.yaml @@ -0,0 +1,68 @@ +name: Create Tag and Release + +on: # yamllint disable-line rule:truthy + workflow_call: + workflow_dispatch: + inputs: + option: + description: 'Select version to release' + required: true + type: choice + default: 'minor' + options: + - major + - minor + - patch + - n-1/n-2 patch (Provide input in the below box) + version: + description: "Patch version to release. example: 2.1.x (Use this only if n-1/n-2 patch is selected)" + required: false + type: string + repository_dispatch: + types: [auto-release-workflow] + +jobs: + process-inputs: + name: Process Inputs + runs-on: ubuntu-latest + outputs: + processedVersion: ${{ steps.set-version.outputs.versionEnv }} + steps: + - name: Process input + id: set-version + shell: bash + run: | + echo "Triggered by: ${{ github.event_name }}" + if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then + echo "versionEnv=minor" >> $GITHUB_OUTPUT + exit 0 + fi + if [[ "${{ github.event.inputs.version }}" != "" && "${{ github.event.inputs.option }}" == "n-1/n-2 patch (Provide input in the below box)" ]]; then + echo "versionEnv=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT + exit 0 + fi + if [[ "${{ github.event.inputs.option }}" != "n-1/n-2 patch (Provide input in the below box)" ]]; then + echo "versionEnv=${{ github.event.inputs.option }}" >> $GITHUB_OUTPUT + exit 0 + fi + echo "versionEnv=minor" >> $GITHUB_OUTPUT + + csm-release: + needs: process-inputs + uses: KshitijaKakde/common-github-actions/.github/workflows/create-tag-release.yaml@main + name: Create Tag and Release + with: + version: ${{ needs.process-inputs.outputs.processedVersion }} + images: 'csi-unity' + secrets: inherit + + next-steps: + name: 📌 Next Steps for Release Process + runs-on: ubuntu-latest + needs: csm-release + steps: + - name: Share next steps with user + run: | + echo "✅ Tag and release completed." + echo "➡️ Please manually trigger the Jenkins image build job: CSM-Images-Build-Nightly." + echo "🚀 Once the Jenkins image build job is successful, trigger the Release Image workflow from GitHub Actions." From bf7844230aff0512b039bfb9960ea9fc8048b815 Mon Sep 17 00:00:00 2001 From: KshitijaKakde <111420075+KshitijaKakde@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:32:29 +0530 Subject: [PATCH 2/2] Create release-image.yaml --- .github/workflows/release-image.yaml | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release-image.yaml diff --git a/.github/workflows/release-image.yaml b/.github/workflows/release-image.yaml new file mode 100644 index 00000000..72dd2b45 --- /dev/null +++ b/.github/workflows/release-image.yaml @@ -0,0 +1,59 @@ +name: Release Image +# Invocable as a reusable workflow +# Can be manually triggered +on: # yamllint disable-line rule:truthy + workflow_call: + workflow_dispatch: + inputs: + option: + description: 'Select version to release' + required: true + type: choice + default: 'minor' + options: + - major + - minor + - patch + - n-1/n-2 patch (Provide input in the below box) + version: + description: "Patch version to release. example: 2.1.x (Use this only if n-1/n-2 patch is selected)" + required: false + type: string + repository_dispatch: + types: [auto-release-workflow] +jobs: + process-inputs: + name: Process Inputs + runs-on: ubuntu-latest + outputs: + processedVersion: ${{ steps.set-version.outputs.versionEnv }} + steps: + - name: Process input + id: set-version + shell: bash + run: | + echo "Triggered by: ${{ github.event_name }}" + if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then + echo "versionEnv=minor" >> $GITHUB_OUTPUT + exit 0 + fi + if [[ "${{ github.event.inputs.version }}" != "" && "${{ github.event.inputs.option }}" == "n-1/n-2 patch (Provide input in the below box)" ]]; then + # if both version and option are provided, then version takes precedence i.e. patch release for n-1/n-2 + echo "versionEnv=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT + exit 0 + fi + if [[ "${{ github.event.inputs.option }}" != "n-1/n-2 patch (Provide input in the below box)" ]]; then + # if only option is provided, then option takes precedence i.e. minor, major or patch release + echo "versionEnv=${{ github.event.inputs.option }}" >> $GITHUB_OUTPUT + exit 0 + fi + # if neither option nor version is provided, then minor release is taken by default (Auto-release) + echo "versionEnv=minor" >> $GITHUB_OUTPUT + csm-release: + needs: [process-inputs] + uses: KshitijaKakde/common-github-actions/.github/workflows/release-image.yaml@main + name: Release CSM Drivers and Modules + with: + version: ${{ needs.process-inputs.outputs.processedVersion }} + images: 'csi-unity' + secrets: inherit