From cebdbc157b31e1c0bfbced93a5dd3030adc863a1 Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Tue, 10 Dec 2024 17:52:43 +0530 Subject: [PATCH 1/6] Github workflow for trigerring the csm release Signed-off-by: meghana_gm --- .../auto-release-csm-driver-module.yaml | 152 ++++++++++++++++++ .../trigger-auto-csm-release-workflow.yaml | 46 ++++++ 2 files changed, 198 insertions(+) create mode 100644 .github/workflows/auto-release-csm-driver-module.yaml create mode 100644 .github/workflows/trigger-auto-csm-release-workflow.yaml diff --git a/.github/workflows/auto-release-csm-driver-module.yaml b/.github/workflows/auto-release-csm-driver-module.yaml new file mode 100644 index 0000000..07b1670 --- /dev/null +++ b/.github/workflows/auto-release-csm-driver-module.yaml @@ -0,0 +1,152 @@ +# Copyright (c) 2024 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 + +# This workflow is used to release CSI Drivers and modules. +name: Release CSM Drivers and Modules + +on: + workflow_call: + workflow_dispatch: + +jobs: + build-and-scan: + name: Build, Scan and Release + runs-on: ubuntu-latest + outputs: + new_version: ${{ steps.calculate_version.outputs.new_version }} + image_name: ${{ steps.extract_image.outputs.image_name }} + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + + - name: Install dependencies + run: go mod tidy + + - name: Build + run: go build -v ./... + + - name: Run malware scan + uses: dell/common-github-actions/malware-scanner@main + with: + directories: . + options: -ri + + - name: Run gosec + uses: dell/common-github-actions/gosec-runner@main + with: + directories: "./..." + + - name: Get Latest Release Version + id: get_release + run: | + REPO="${{ github.repository }}" + echo "Fetching latest release for $REPO" + RELEASE_VERSION=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name' | sed 's/^v//') + if [[ "$RELEASE_VERSION" == "null" ]]; then + echo "No release found for $REPO" + RELEASE_VERSION="0.0.0" + fi + echo "Latest release version: $RELEASE_VERSION" + echo "::set-output name=release_version::$RELEASE_VERSION" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Calculate Next Minor Version + id: calculate_version + run: | + RELEASE_VERSION="${{ steps.get_release.outputs.release_version }}" + VERSION="$RELEASE_VERSION" + IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" + NEXT_MINOR=$((MINOR + 1)) + NEW_VERSION="$MAJOR.$NEXT_MINOR.0" + echo "Next version: $NEW_VERSION" + echo "::set-output name=new_version::$NEW_VERSION" + + - name: Extract Image Name + id: extract_image + run: | + REPO="${{ github.repository }}" + IMAGE_NAME=$(echo "$REPO" | awk -F'/' '{print $2}') + echo "Image name: $IMAGE_NAME" + echo "::set-output name=image_name::$IMAGE_NAME" + + + push-images: + name: Pull, Tag and Push Images + needs: build-and-scan + runs-on: ubuntu-latest + steps: + - name: Log in to Quay.io + run: echo "${{ secrets.QUAY_PASSWORD }}" | docker login quay.io -u "${{ secrets.QUAY_USERNAME }}" --password-stdin + + - name: Log in to Docker Hub + run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login docker.io -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin + + - name: Pull nightly image from Quay.io + #run: docker pull quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly + run: echo "dummy pull" + + - name: Retag image for Quay.io + #run: | + # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:v${{ steps.calculate_version.outputs.new_version }} + # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:latest + run: echo "dummy retag for Quay.io" + + - name: Retag image for Docker Hub + #run: | + # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly dellemc/${{ steps.extract_image.outputs.image_name }}:v${{ steps.calculate_version.outputs.new_version }} + # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly dellemc/${{ steps.extract_image.outputs.image_name }}:latest + run: echo "dummy retag for Docker Hub" + + - name: Push ${{ steps.calculate_version.outputs.new_version }} and latest tag to Quay.io + run: echo "Dummy push" + + - name: Push ${{ steps.calculate_version.outputs.new_version }} and latest tag to Docker Hub + run: echo "Dummy push" + + create-release: + name: Create Release + needs: + - build-and-scan + - push-images + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Create new tag + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git tag v${{ needs.build-and-scan.outputs.new_version }} + git push origin v${{ needs.build-and-scan.outputs.new_version }} + + - name: Create Release + id: release_notes + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ needs.build-and-scan.outputs.new_version }} + name: Release v${{ needs.build-and-scan.outputs.new_version }} + draft: true + prerelease: false + generate_release_notes: true + make_latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create release branch + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git checkout -b release/v${{ needs.build-and-scan.outputs.new_version }} + git push origin release/v${{ needs.build-and-scan.outputs.new_version }} \ No newline at end of file diff --git a/.github/workflows/trigger-auto-csm-release-workflow.yaml b/.github/workflows/trigger-auto-csm-release-workflow.yaml new file mode 100644 index 0000000..f99ecac --- /dev/null +++ b/.github/workflows/trigger-auto-csm-release-workflow.yaml @@ -0,0 +1,46 @@ +# Copyright (c) 2024 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 + +# Trigger workflow for auto release of CSM projects +name: Trigger Auto Release Workflow + +on: + workflow_dispatch: + +jobs: + trigger: + name: Trigger Auto Release + runs-on: ubuntu-latest + + strategy: + matrix: + repo: + [ + "dell/csi-metadata-retriever", + #"dell/csi-powerflex", + "dell/csi-powermax", + #"dell/csi-powerscale", + "dell/csi-powerstore", + "dell/csi-unity", + "dell/csm-metrics-powermax", + "dell/csm-metrics-powerscale", + "dell/csm-metrics-powerstore", + "dell/csm-metrics-unity", + "dell/csm-operator", + "dell/csm-replication", + ] + + steps: + - name: Trigger Auto Release + uses: peter-evans/repository-dispatch@v3 + with: + # For token information, see: https://github.com/peter-evans/repository-dispatch/tree/main?tab=readme-ov-file#token + token: ${{ secrets.CSMBOT_PAT }} + repository: ${{ matrix.repo }} + event-type: auto-release-workflow + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' \ No newline at end of file From 63da048d996d1d22216ed950dd547521d8a7ba7c Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Tue, 10 Dec 2024 17:58:20 +0530 Subject: [PATCH 2/6] Github workflow for trigerring the csm release Signed-off-by: meghana_gm --- .github/workflows/auto-release-csm-driver-module.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release-csm-driver-module.yaml b/.github/workflows/auto-release-csm-driver-module.yaml index 07b1670..7e5f533 100644 --- a/.github/workflows/auto-release-csm-driver-module.yaml +++ b/.github/workflows/auto-release-csm-driver-module.yaml @@ -7,7 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # This workflow is used to release CSI Drivers and modules. -name: Release CSM Drivers and Modules +name: Auto Release CSM Drivers and Modules on: workflow_call: From 4b58b29011b8851e313ca164fa53c8e43e6015ad Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Wed, 11 Dec 2024 18:30:44 +0530 Subject: [PATCH 3/6] Github workflow for trigerring the csm release Signed-off-by: meghana_gm --- .../auto-release-csm-driver-module.yaml | 152 ------------------ .../workflows/csm-release-driver-module.yaml | 66 ++++---- .../trigger-auto-csm-release-workflow.yaml | 13 +- 3 files changed, 44 insertions(+), 187 deletions(-) delete mode 100644 .github/workflows/auto-release-csm-driver-module.yaml diff --git a/.github/workflows/auto-release-csm-driver-module.yaml b/.github/workflows/auto-release-csm-driver-module.yaml deleted file mode 100644 index 7e5f533..0000000 --- a/.github/workflows/auto-release-csm-driver-module.yaml +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright (c) 2024 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 - -# This workflow is used to release CSI Drivers and modules. -name: Auto Release CSM Drivers and Modules - -on: - workflow_call: - workflow_dispatch: - -jobs: - build-and-scan: - name: Build, Scan and Release - runs-on: ubuntu-latest - outputs: - new_version: ${{ steps.calculate_version.outputs.new_version }} - image_name: ${{ steps.extract_image.outputs.image_name }} - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.23" - - - name: Install dependencies - run: go mod tidy - - - name: Build - run: go build -v ./... - - - name: Run malware scan - uses: dell/common-github-actions/malware-scanner@main - with: - directories: . - options: -ri - - - name: Run gosec - uses: dell/common-github-actions/gosec-runner@main - with: - directories: "./..." - - - name: Get Latest Release Version - id: get_release - run: | - REPO="${{ github.repository }}" - echo "Fetching latest release for $REPO" - RELEASE_VERSION=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name' | sed 's/^v//') - if [[ "$RELEASE_VERSION" == "null" ]]; then - echo "No release found for $REPO" - RELEASE_VERSION="0.0.0" - fi - echo "Latest release version: $RELEASE_VERSION" - echo "::set-output name=release_version::$RELEASE_VERSION" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Calculate Next Minor Version - id: calculate_version - run: | - RELEASE_VERSION="${{ steps.get_release.outputs.release_version }}" - VERSION="$RELEASE_VERSION" - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" - NEXT_MINOR=$((MINOR + 1)) - NEW_VERSION="$MAJOR.$NEXT_MINOR.0" - echo "Next version: $NEW_VERSION" - echo "::set-output name=new_version::$NEW_VERSION" - - - name: Extract Image Name - id: extract_image - run: | - REPO="${{ github.repository }}" - IMAGE_NAME=$(echo "$REPO" | awk -F'/' '{print $2}') - echo "Image name: $IMAGE_NAME" - echo "::set-output name=image_name::$IMAGE_NAME" - - - push-images: - name: Pull, Tag and Push Images - needs: build-and-scan - runs-on: ubuntu-latest - steps: - - name: Log in to Quay.io - run: echo "${{ secrets.QUAY_PASSWORD }}" | docker login quay.io -u "${{ secrets.QUAY_USERNAME }}" --password-stdin - - - name: Log in to Docker Hub - run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login docker.io -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin - - - name: Pull nightly image from Quay.io - #run: docker pull quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly - run: echo "dummy pull" - - - name: Retag image for Quay.io - #run: | - # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:v${{ steps.calculate_version.outputs.new_version }} - # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:latest - run: echo "dummy retag for Quay.io" - - - name: Retag image for Docker Hub - #run: | - # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly dellemc/${{ steps.extract_image.outputs.image_name }}:v${{ steps.calculate_version.outputs.new_version }} - # docker tag quay.io/dell/container-storage-modules/${{ steps.extract_image.outputs.image_name }}:nightly dellemc/${{ steps.extract_image.outputs.image_name }}:latest - run: echo "dummy retag for Docker Hub" - - - name: Push ${{ steps.calculate_version.outputs.new_version }} and latest tag to Quay.io - run: echo "Dummy push" - - - name: Push ${{ steps.calculate_version.outputs.new_version }} and latest tag to Docker Hub - run: echo "Dummy push" - - create-release: - name: Create Release - needs: - - build-and-scan - - push-images - runs-on: ubuntu-latest - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - - name: Create new tag - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - git tag v${{ needs.build-and-scan.outputs.new_version }} - git push origin v${{ needs.build-and-scan.outputs.new_version }} - - - name: Create Release - id: release_notes - uses: softprops/action-gh-release@v2 - with: - tag_name: v${{ needs.build-and-scan.outputs.new_version }} - name: Release v${{ needs.build-and-scan.outputs.new_version }} - draft: true - prerelease: false - generate_release_notes: true - make_latest: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create release branch - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - git checkout -b release/v${{ needs.build-and-scan.outputs.new_version }} - git push origin release/v${{ needs.build-and-scan.outputs.new_version }} \ No newline at end of file diff --git a/.github/workflows/csm-release-driver-module.yaml b/.github/workflows/csm-release-driver-module.yaml index e9be32e..616f78c 100644 --- a/.github/workflows/csm-release-driver-module.yaml +++ b/.github/workflows/csm-release-driver-module.yaml @@ -12,14 +12,15 @@ name: Release CSM Drivers and Modules # Invocable as a reusable workflow on: workflow_call: - workflow_dispatch: inputs: version: description: 'Version to release (major, minor, patch), ex: 1.0.0' required: true + type: string image: description: 'Image name, ex: csm-powerstore' required: true + type: string jobs: build-and-scan: @@ -59,56 +60,61 @@ jobs: needs: build-and-scan runs-on: ubuntu-latest steps: - - name: Log in to Quay.io - run: echo "${{ secrets.QUAY_PASSWORD }}" | docker login quay.io -u "${{ secrets.QUAY_USERNAME }}" --password-stdin + - name: Image name + run: echo "Image name:" "${{ inputs.image }}" + # - name: Log in to Quay.io + # run: echo "${{ secrets.QUAY_PASSWORD }}" | docker login quay.io -u "${{ secrets.QUAY_USERNAME }}" --password-stdin - - name: Log in to Docker Hub - run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login docker.io -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin + # - name: Log in to Docker Hub + # run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login docker.io -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin - - name: Pull nightly image from Quay.io - run: docker pull quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:nightly + # - name: Pull nightly image from Quay.io + # run: docker pull quay.io/dell/container-storage-modules/${{ inputs.image }}:nightly - - name: Retag image for Quay.io - run: | - docker tag quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:nightly quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:v${{ github.event.inputs.version }} + # - name: Retag image for Quay.io + # run: | + # docker tag quay.io/dell/container-storage-modules/${{ inputs.image }}:nightly quay.io/dell/container-storage-modules/${{ inputs.image }}:v${{ inputs.version }} + + # docker tag quay.io/dell/container-storage-modules/${{ inputs.image }}:nightly quay.io/dell/container-storage-modules/${{ inputs.image }}:latest - docker tag quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:nightly quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:latest + # - name: Retag image for Docker Hub + # run: | + # docker tag quay.io/dell/container-storage-modules/${{ inputs.image }}:nightly dellemc/${{ inputs.image }}:v${{ inputs.version }} - - name: Retag image for Docker Hub - run: | - docker tag quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:nightly dellemc/${{ github.event.inputs.image }}:v${{ github.event.inputs.version }} + # docker tag quay.io/dell/container-storage-modules/${{ inputs.image }}:nightly dellemc/${{ inputs.image }}:latest - docker tag quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:nightly dellemc/${{ github.event.inputs.image }}:latest + # - name: Push ${{ inputs.version }} and latest tag to Quay.io + # run: | + # docker push quay.io/dell/container-storage-modules/${{ inputs.image }}:v${{ inputs.version }} + # docker push quay.io/dell/container-storage-modules/${{ inputs.image }}:latest - - name: Push ${{ github.event.inputs.version }} and latest tag to Quay.io - run: | - docker push quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:v${{ github.event.inputs.version }} - docker push quay.io/dell/container-storage-modules/${{ github.event.inputs.image }}:latest - - - name: Push ${{ github.event.inputs.version }} and latest tag to Docker Hub - run: | - docker push dellemc/${{ github.event.inputs.image }}:v${{ github.event.inputs.version }} - docker push dellemc/${{ github.event.inputs.image }}:latest + # - name: Push ${{ inputs.version }} and latest tag to Docker Hub + # run: | + # docker push dellemc/${{ inputs.image }}:v${{ inputs.version }} + # docker push dellemc/${{ inputs.image }}:latest create-release: name: Create Release needs: push-images runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Create new tag run: | git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com' - git tag v${{ github.event.inputs.version }} - git push origin v${{ github.event.inputs.version }} + git tag v${{ inputs.version }} + git push origin v${{ inputs.version }} # TODO: attach built binaries to the release - name: Create Release id: release_notes uses: softprops/action-gh-release@v2 with: - tag_name: v${{ github.event.inputs.version }} - name: Release v${{ github.event.inputs.version }} + tag_name: v${{ inputs.version }} + name: Release v${{ inputs.version }} draft: true prerelease: false generate_release_notes: true @@ -126,5 +132,5 @@ jobs: run: | git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com' - git checkout -b release/v${{ github.event.inputs.version }} - git push origin release/v${{ github.event.inputs.version }} + git checkout -b release/v${{ inputs.version }} + git push origin release/v${{ inputs.version }} diff --git a/.github/workflows/trigger-auto-csm-release-workflow.yaml b/.github/workflows/trigger-auto-csm-release-workflow.yaml index f99ecac..3cf6e3c 100644 --- a/.github/workflows/trigger-auto-csm-release-workflow.yaml +++ b/.github/workflows/trigger-auto-csm-release-workflow.yaml @@ -14,7 +14,7 @@ on: jobs: trigger: - name: Trigger Auto Release + name: Trigger Release of CSM Drivers and Modules runs-on: ubuntu-latest strategy: @@ -22,9 +22,9 @@ jobs: repo: [ "dell/csi-metadata-retriever", - #"dell/csi-powerflex", + "dell/csi-powerflex", "dell/csi-powermax", - #"dell/csi-powerscale", + "dell/csi-powerscale", "dell/csi-powerstore", "dell/csi-unity", "dell/csm-metrics-powermax", @@ -33,14 +33,17 @@ jobs: "dell/csm-metrics-unity", "dell/csm-operator", "dell/csm-replication", + "dell/karavi-authorization" + "dell/karavi-resiliency" + "dell/karavi-observability" ] steps: - - name: Trigger Auto Release + - name: Trigger Release of CSM Drivers and Modules uses: peter-evans/repository-dispatch@v3 with: # For token information, see: https://github.com/peter-evans/repository-dispatch/tree/main?tab=readme-ov-file#token token: ${{ secrets.CSMBOT_PAT }} repository: ${{ matrix.repo }} event-type: auto-release-workflow - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' \ No newline at end of file + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' From fc591b6437697df78d8a29ba1ab12e058a32288f Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Wed, 11 Dec 2024 18:37:15 +0530 Subject: [PATCH 4/6] Github workflow for trigerring the csm release Signed-off-by: meghana_gm --- .github/workflows/trigger-auto-csm-release-workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-auto-csm-release-workflow.yaml b/.github/workflows/trigger-auto-csm-release-workflow.yaml index 3cf6e3c..446a328 100644 --- a/.github/workflows/trigger-auto-csm-release-workflow.yaml +++ b/.github/workflows/trigger-auto-csm-release-workflow.yaml @@ -7,7 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # Trigger workflow for auto release of CSM projects -name: Trigger Auto Release Workflow +name: Trigger Release of CSM Drivers and Modules on: workflow_dispatch: From 250e2c17a2036fd332502672124364add7ff2620 Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Wed, 11 Dec 2024 23:02:56 +0530 Subject: [PATCH 5/6] Github workflow for trigerring the csm release Signed-off-by: meghana_gm --- .../trigger-auto-csm-release-workflow.yaml | 2 + README.md | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/.github/workflows/trigger-auto-csm-release-workflow.yaml b/.github/workflows/trigger-auto-csm-release-workflow.yaml index 446a328..eec4f3a 100644 --- a/.github/workflows/trigger-auto-csm-release-workflow.yaml +++ b/.github/workflows/trigger-auto-csm-release-workflow.yaml @@ -36,6 +36,8 @@ jobs: "dell/karavi-authorization" "dell/karavi-resiliency" "dell/karavi-observability" + "dell/karavi-metrics-powerflex" + "dell/karavi-topology" ] steps: diff --git a/README.md b/README.md index 03da3a9..0ca8d1c 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,87 @@ jobs: uses: dell/common-github-actions/.github/workflows/go-common.yml@main ``` +### csm-release-driver-module + +This workflow automates the release of CSM drivers and modules repositories. The workflow accepts two parameters as version and image, and can be used from any repo by creating a workflow that resembles the following. + +For manual trigger from driver and module repositories, here is the example for the csi-powerscale repo: + +```yaml +name: Release CSIPowerScale +on: + workflow_call: + workflow_dispatch: + inputs: + version: + description: 'Version to release (major, minor, patch) Ex: 1.0.0' + required: true + image: + description: 'Image name to release Ex: csi-isilon' + required: true + +jobs: + release: + uses: dell/common-github-actions/.github/workflows/csm-release-driver-module.yaml@main + name: Release CSM Drivers and Modules + with: + version: ${{ github.event.inputs.version }} + image: ${{ github.event.inputs.image }} + secrets: inherit +``` + +For Auto release of the driver and module repositories, here is the example for the csi-powerscale repo: + +```yaml +name: Auto Release CSIPowerScale +on: + workflow_dispatch: + repository_dispatch: + types: [auto-driver-module-release-workflow] + +jobs: + calculate-version: + runs-on: ubuntu-latest + outputs: + new-version: ${{ steps.set-version.outputs.version }} + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch the full history including tags + + - name: Get latest release version + id: get-latest-version + run: | + latest_version=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo "latest_version=${latest_version}" >> $GITHUB_ENV + + - name: Increment minor version and remove 'v' prefix + id: set-version + run: | + version=${{ env.latest_version }} + clean_version=${version#v} + + # Parse version parts + major=$(echo $clean_version | cut -d'.' -f1) + minor=$(echo $clean_version | cut -d'.' -f2) + patch=$(echo $clean_version | cut -d'.' -f3) + new_minor=$((minor + 1)) + new_version="${major}.${new_minor}.0" + + echo "New version: $new_version" + echo "::set-output name=version::$new_version" + + csm-release: + needs: calculate-version + uses: dell/common-github-actions/.github/workflows/csm-release-driver-module.yaml@main + with: + version: ${{ inputs.version || needs.calculate-version.outputs.new-version }} + image: "csi-isilon" # Please provide the appropriate image name + secrets: inherit +``` + + ## Support Don’t hesitate to ask! Contact the team and community on [our support](./docs/SUPPORT.md). From 2179d89bfb89ac98915f6202af0499f16efdaebe Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Wed, 11 Dec 2024 23:54:42 +0530 Subject: [PATCH 6/6] Github workflow for trigerring the csm release Signed-off-by: meghana_gm --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ca8d1c..eade90a 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ jobs: ### csm-release-driver-module This workflow automates the release of CSM drivers and modules repositories. The workflow accepts two parameters as version and image, and can be used from any repo by creating a workflow that resembles the following. +The manual workflow is recommended to be used for out of band releases such as patch releases or when the increment is a major version change. For manual trigger from driver and module repositories, here is the example for the csi-powerscale repo: @@ -176,7 +177,7 @@ name: Auto Release CSIPowerScale on: workflow_dispatch: repository_dispatch: - types: [auto-driver-module-release-workflow] + types: [auto-release-workflow] jobs: calculate-version: