diff --git a/.github/workflows/create-tag-release.yaml b/.github/workflows/create-tag-release.yaml index 3780f9b0..42b2c4e1 100644 --- a/.github/workflows/create-tag-release.yaml +++ b/.github/workflows/create-tag-release.yaml @@ -12,18 +12,29 @@ name: Create Tag and Release on: workflow_call: inputs: - version: - description: "Semantic version to release. Ex: major, minor, or patch" + option: + description: "Type of release. Ex: major, minor, patch, or version." type: string required: true - images: - description: "List of image names. Example: csi-powerstore,csi-isilon" + version: + description: "Specific semver version to release. Only used when 'version' is the selected option. Ex: v2.1.0." type: string - required: true + required: false jobs: + process-inputs: + name: Process Inputs + uses: dell/common-github-actions/.github/workflows/process-inputs.yaml@main + with: + option: ${{ inputs.option }} + version: ${{ inputs.version }} + secrets: inherit + build-and-scan: name: Build and Scan + needs: [process-inputs] + outputs: + processedVersion: ${{ needs.process-inputs.outputs.processedVersion }} runs-on: ubuntu-latest steps: - name: Checkout the code @@ -42,17 +53,17 @@ jobs: - name: Build binaries run: | echo "Building binaries to attach to the release if any..." - if "${{ inputs.images == 'cert-csi' }}"; then - make build - mv cert-csi cert-csi-linux-amd64 - echo "BIN_NAME=cert-csi-linux-amd64" >> $GITHUB_ENV + if [ "${GITHUB_REPOSITORY}" == "dell/cert-csi" ]; then + make build + mv cert-csi cert-csi-linux-amd64 + echo "BIN_NAME=cert-csi-linux-amd64" >> $GITHUB_ENV fi - if "${{ contains(inputs.images, 'dell-csi-replicator') || contains(inputs.images, 'dell-replication-controller') }}"; then - cd repctl - make build - mv repctl repctl-linux-amd64 - mv repctl-linux-amd64 ../ - echo "BIN_NAME=repctl-linux-amd64" >> $GITHUB_ENV + if [ "${GITHUB_REPOSITORY}" == "dell/csm-replication" ]; then + cd repctl + make build + mv repctl repctl-linux-amd64 + mv repctl-linux-amd64 ../ + echo "BIN_NAME=repctl-linux-amd64" >> $GITHUB_ENV fi - name: Upload Binaries @@ -66,8 +77,8 @@ jobs: release-and-tag: name: Tag and Release - needs: build-and-scan + needs: [build-and-scan] uses: dell/common-github-actions/.github/workflows/release-creator.yaml@main with: - version: ${{ inputs.version }} + version: ${{ needs.build-and-scan.outputs.processedVersion }} secrets: inherit diff --git a/.github/workflows/csm-release-driver-module.yaml b/.github/workflows/csm-release-driver-module.yaml deleted file mode 100644 index 8e19ad9a..00000000 --- a/.github/workflows/csm-release-driver-module.yaml +++ /dev/null @@ -1,129 +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: Release CSM Drivers and Modules - -# Invocable as a reusable workflow -on: - workflow_call: - inputs: - version: - description: "Semantic version to release. Ex: major, minor, or patch" - type: string - required: true - images: - description: "List of image names. Example: csi-powerstore,csi-isilon" - type: string - required: true -jobs: - build-and-scan: - name: Build and Scan - runs-on: ubuntu-latest - steps: - - name: Checkout the code - uses: actions/checkout@v5 - with: - fetch-depth: 0 # Fetch the full history including tags - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.25" - - name: Install dependencies - run: go mod tidy - - name: Build binaries - run: | - echo "Building binaries to attach to the release if any..." - if "${{ inputs.images == 'cert-csi' }}"; then - make build - mv cert-csi cert-csi-linux-amd64 - echo "BIN_NAME=cert-csi-linux-amd64" >> $GITHUB_ENV - fi - if "${{ contains(inputs.images, 'dell-csi-replicator') || contains(inputs.images, 'dell-replication-controller') }}"; then - cd repctl - make build - mv repctl repctl-linux-amd64 - mv repctl-linux-amd64 ../ - echo "BIN_NAME=repctl-linux-amd64" >> $GITHUB_ENV - fi - - - name: Upload Binaries - if: ${{ env.BIN_NAME != '' }} - uses: actions/upload-artifact@v4.6.1 - env: - BIN_NAME: ${{ env.BIN_NAME }} - with: - name: ${{ env.BIN_NAME }} - path: ${{ env.BIN_NAME }} - - release-and-tag: - name: Tag and Release - needs: build-and-scan - uses: dell/common-github-actions/.github/workflows/release-creator.yaml@main - with: - version: ${{ inputs.version }} - secrets: inherit - - # We will not push images to quay.io for a patch release as we do not have the image to be retagged - # The developers need to build and push it manually to the repository - push-images: - if: ${{ inputs.version == 'patch' || inputs.version == 'minor' || inputs.version == 'major' }} - name: Release images to Quay - needs: release-and-tag - runs-on: ubuntu-latest - steps: - - name: Push images to Quay.io - shell: bash - run: | - # Push each comma seperated images by splitting the string with ',' - images_list=$(echo '${{ inputs.images }}' | tr -d '[]"' | tr ',' ' ') - - REPOSITORY="dell/container-storage-modules" - - for image in $images_list; do - - latest_version=$(curl -s https://quay.io/api/v1/repository/$REPOSITORY/$image?tab=tags | jq -r '.tags[].name' | sort -V | tail -n 1) - echo "Current latest version of $image:$latest_version" - - IFS='.' read -r -a version_parts <<< "$latest_version" - - if "${{ inputs.version == 'major' }}"; then - # major version bump up - version_parts[0]=$(expr ${version_parts[0]} + 1) - new_version="${version_parts[0]}.0.0" - fi - if "${{ inputs.version == 'minor' }}"; then - # minor version bump up - version_parts[1]=$(expr ${version_parts[1]} + 1) - new_version="${version_parts[0]}.${version_parts[1]}.0" - fi - if "${{ inputs.version == 'patch' }}"; then - # patch version bump up - version_parts[2]=$(expr ${version_parts[2]} + 1) - new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" - fi - - # Get manifest digest - SHA=$(curl -s --location --request GET https://quay.io/api/v1/repository/$REPOSITORY/$image/tag?specificTag=nightly --header 'Content-Type: application/json' --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' | jq -r '.tags[0].manifest_digest') - echo "Pushing image: $image:$new_version" - - # Create version and latest tags - curl --location --request PUT https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/$new_version \ - --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \ - --data-raw '{ - "manifest_digest": "'"$SHA"'" - }' - - curl --location --request PUT https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/latest \ - --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \ - --data-raw '{ - "manifest_digest": "'"$SHA"'" - }' - done diff --git a/.github/workflows/csm-release-libs.yaml b/.github/workflows/csm-release-libs.yaml index f3d5f64f..bb53b06b 100644 --- a/.github/workflows/csm-release-libs.yaml +++ b/.github/workflows/csm-release-libs.yaml @@ -13,13 +13,28 @@ name: Release Go Client Libraries on: workflow_call: inputs: - version: - description: 'Semantic version to release. Ex: major, minor, or patch' + option: + description: "Type of release. Ex: major, minor, patch, or version." + type: string required: true + version: + description: "Specific semver version to release. Only used when 'version' is the selected option. Ex: v2.1.0." type: string + required: false jobs: + process-inputs: + name: Process Inputs + uses: dell/common-github-actions/.github/workflows/process-inputs.yaml@main + with: + option: ${{ inputs.option }} + version: ${{ inputs.version }} + secrets: inherit + build-and-scan: name: Build and Scan + needs: [process-inputs] + outputs: + processedVersion: ${{ needs.process-inputs.outputs.processedVersion }} runs-on: ubuntu-latest steps: - name: Checkout the code @@ -42,8 +57,8 @@ jobs: release-and-tag: name: Tag and Release - needs: build-and-scan + needs: [build-and-scan] uses: dell/common-github-actions/.github/workflows/release-creator.yaml@main with: - version: ${{ inputs.version }} + version: ${{ needs.build-and-scan.outputs.processedVersion }} secrets: inherit diff --git a/.github/workflows/process-inputs.yaml b/.github/workflows/process-inputs.yaml new file mode 100644 index 00000000..73cd078d --- /dev/null +++ b/.github/workflows/process-inputs.yaml @@ -0,0 +1,79 @@ +# 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 + +name: Process Inputs for Release + +# Invocable as a reusable workflow +on: + workflow_call: + inputs: + option: + description: "Type of release. Ex: major, minor, patch, or version." + type: string + required: true + version: + description: "Specific semver version to release. Only used when 'version' is the selected option. Ex: v2.1.0." + type: string + required: false + + outputs: + processedVersion: + description: "The type of release. Ex: major, minor, patch, or semver." + value: ${{ jobs.process-inputs.outputs.processedVersion }} + +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: | + valid_options=("major" "minor" "patch" "version") + if [[ ! "${valid_options[@]}" =~ "${{ inputs.option }}" ]]; then + echo "Invalid option: ${{ inputs.option }}" + exit 1 + fi + + # When worker is triggered by "repository_dispatch" for auto release, if the input option + # is not set to a default due to the action not going through "workflow_dispatch", the option + # will be set to "minor" by default. + if [[ "${{ inputs.option }}" == "" ]]; then + echo "versionEnv=minor" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if [[ "${{ inputs.option }}" == "version" && "${{ inputs.version }}" != "" ]]; then + # if both version and option are provided, then version takes precedence i.e. for releasing a specific version, not incremental. + + # remove prefix 'v' + version="${{ inputs.version }}" + clean_version="${version#v}" + + # verify the version is in semver format + if ! [[ "$clean_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Version "$clean_version" is not in semver format. Ex: v2.1.0" + exit 1 + fi + + echo "versionEnv=$clean_version" >> "$GITHUB_OUTPUT" + exit 0 + fi + + # This should take care of all other options aside from version. + if [[ "${{ inputs.option }}" != "version" ]]; then + # if only option is provided, then option takes precedence i.e. minor, major or patch release + echo "versionEnv=${{ inputs.option }}" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "Failed to process inputs" + exit 1 diff --git a/.github/workflows/release-creator.yaml b/.github/workflows/release-creator.yaml index 8c403986..ce3da580 100644 --- a/.github/workflows/release-creator.yaml +++ b/.github/workflows/release-creator.yaml @@ -17,10 +17,17 @@ on: description: "Semantic version to release. Ex: major, minor, or patch" required: true type: string + + outputs: + rel_version: + description: "The released version of the repository" + value: ${{ jobs.tag-and-release.outputs.rel_version }} jobs: tag-and-release: name: Create tag and release runs-on: ubuntu-latest + outputs: + rel_version: ${{ steps.create-rel-branch.outputs.rel_version }} steps: - name: Checkout the code uses: actions/checkout@v5 @@ -28,26 +35,27 @@ jobs: fetch-depth: 0 # Fetch the full history including tags ref: ${{ github.ref }} # Checkout the branch from which the workflow is triggered - # we will set the release version based on the user given input for older patch releases only ex: n-1, n-2 + # we will set the release version based on the user given input - name: Set release version - if: ${{ inputs.version != 'patch' || inputs.version != 'minor' || inputs.version != 'major' }} + if: ${{ inputs.version != 'patch' && inputs.version != 'minor' && inputs.version != 'major' }} + env: + VERSION: "${{ inputs.version }}" run: | - echo "REL_VERSION=v${{ inputs.version }}" >> $GITHUB_ENV + echo "REL_VERSION=v${{ env.VERSION }}" >> $GITHUB_ENV - # we will auto bump up the version if it is only patch, minor, or major else we will just use the user given input + # we will bump up the version if it is one of patch, minor, or major - name: Get latest release if: ${{ inputs.version == 'patch' || inputs.version == 'minor' || inputs.version == 'major' }} run: | latest_version=$(curl -s https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest | jq -r .tag_name) - echo "MY_VAR=${latest_version}" >> $GITHUB_ENV - echo "latest_version=${latest_version}" + echo "MY_VAR=${latest_version}" >> $GITHUB_ENV - name: Increment version if: ${{ inputs.version == 'patch' || inputs.version == 'minor' || inputs.version == 'major' }} env: MY_VAR: ${{ env.MY_VAR }} run: | - current_version=$MY_VAR + current_version="$MY_VAR" # The latest version does not exist. Set it to v0.0.0. if [[ "$current_version" = "null" ]]; then @@ -56,7 +64,7 @@ jobs: current_version=(${current_version#v}) # remove 'v' prefix from $current_version" - IFS='.' read -r -a version_parts <<< "$current_version" + IFS='.' read -r -a version_parts <<< "$current_version" if "${{ inputs.version == 'major' }}"; then # major version bump up @@ -100,14 +108,20 @@ jobs: uses: actions/download-artifact@v5.0.0 # This is required to check if the binary exists and update its name to the release. - - run: | - FILE="./cert-csi-linux-amd64/cert-csi-linux-amd64" - if [ -d "repctl-linux-amd64" ]; then - FILE="./repctl-linux-amd64/repctl-linux-amd64" + - name: Set file name + shell: bash + run: | + echo "Checking downloaded artifacts..." + FILE="" + if [ -f "cert-csi-linux-amd64" ]; then + FILE="cert-csi-linux-amd64" + elif [ -f "repctl-linux-amd64" ]; then + FILE="repctl-linux-amd64" + else + echo "No binary file found." fi - echo "File name: $FILE" + echo "FILE_NAME=$FILE" >> $GITHUB_ENV - shell: bash - name: Create Release uses: softprops/action-gh-release@v2 @@ -125,6 +139,7 @@ jobs: FILE_NAME: ${{ env.FILE_NAME }} - name: Create release branch + id: create-rel-branch env: REL_VERSION: ${{ env.REL_VERSION }} run: | @@ -137,3 +152,6 @@ jobs: git checkout -b $branch_name git push origin $branch_name fi + + # Save the release version after everything is succcessful. + echo "rel_version=$REL_VERSION" >> $GITHUB_OUTPUT diff --git a/.github/workflows/release-image.yaml b/.github/workflows/release-image.yaml deleted file mode 100644 index 9de2e100..00000000 --- a/.github/workflows/release-image.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# 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 - -# This workflow is used to push images to quay.io -name: Release Image - -# Invocable as a reusable workflow -on: - workflow_call: - inputs: - version: - description: "Semantic version to release. Ex: major, minor, or patch" - type: string - required: true - images: - description: "List of image names. Example: csi-powerstore,csi-isilon" - type: string - required: true - -jobs: - push-images: - if: ${{ inputs.version == 'patch' || inputs.version == 'minor' || inputs.version == 'major' }} - name: Release images to Quay - runs-on: ubuntu-latest - steps: - - name: Push images to Quay.io - shell: bash - run: | - images_list=$(echo '${{ inputs.images }}' | tr -d '[]"' | tr ',' ' ') - REPOSITORY="dell/container-storage-modules" - - for image in $images_list; do - latest_version=$(curl -s https://quay.io/api/v1/repository/$REPOSITORY/$image?tab=tags | jq -r '.tags[].name' | sort -V | tail -n 1) - echo "Current latest version of $image:$latest_version" - - IFS='.' read -r -a version_parts <<< "$latest_version" - - if "${{ inputs.version == 'major' }}"; then - version_parts[0]=$(expr ${version_parts[0]} + 1) - new_version="${version_parts[0]}.0.0" - fi - if "${{ inputs.version == 'minor' }}"; then - version_parts[1]=$(expr ${version_parts[1]} + 1) - new_version="${version_parts[0]}.${version_parts[1]}.0" - fi - if "${{ inputs.version == 'patch' }}"; then - version_parts[2]=$(expr ${version_parts[2]} + 1) - new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" - fi - - SHA=$(curl -s --location --request GET https://quay.io/api/v1/repository/$REPOSITORY/$image/tag?specificTag=nightly --header 'Content-Type: application/json' --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' | jq -r '.tags[0].manifest_digest') - echo "Pushing image: $image:$new_version" - - curl --location --request PUT https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/$new_version \ - --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \ - --data-raw '{ - "manifest_digest": "'"$SHA"'" - }' - - curl --location --request PUT https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/latest \ - --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer ${{ secrets.QUAY_API_TOKEN }}' \ - --data-raw '{ - "manifest_digest": "'"$SHA"'" - }' - done diff --git a/README.md b/README.md index f8bbe4df..85fa989f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ This repository contains a set of reusable actions and workflows, designed to be - [Go Static Analysis](#go-static-analysis) - [Update Go Version](#go-version-workflow) - [Go Common](#go-common) - - [Release CSM Driver and Modules](#csm-release-driver-module) + - [Create Tag and Release](#create-tag-release) - [Update Dell Libraries to Latest Commits](#update-libraries-to-commits) - [Update Dell Libraries](#update-libraries) - [Dockerfile Modifications](#image-version-workflow) @@ -145,9 +145,7 @@ jobs: ``` ### create-tag-release -This workflow automates the creation of Tag and Release in driver and module Github 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: +This workflow automates the creation of Tag and Release in driver and module Github repositories. The workflow accepts two parameters, and can be used from any repo by creating a workflow that resembles the following: ```yaml name: Create Tag and Release @@ -158,224 +156,27 @@ on: # yamllint disable-line rule:truthy workflow_dispatch: inputs: option: - description: 'Select version to release' + description: "Select type of release. If first release, use major and it will release v1.0.0." required: true type: choice - default: 'minor' + default: "minor" options: - major - minor - patch - - n-1/n-2 patch (Provide input in the below box) + - version version: - description: "Patch version to release. example: 2.1.x (Use this only if n-1/n-2 patch is selected)" + description: "Specific semver version to release. Only used when 'version' is the selected option. Example: v2.1.x." 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: dell/common-github-actions/.github/workflows/create-tag-release.yaml@main name: Create Tag and Release + uses: dell/common-github-actions/.github/workflows/create-tag-release.yaml@main with: - version: ${{ needs.process-inputs.outputs.processedVersion }} - images: 'csi-isilon' - 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." -``` -### release-image - -This workflow automates releasing the images to quay.io. The workflow accepts two parameters as version and image, and can be used from any repo by creating a workflow that resembles the following. - -Before manually triggering this workflow from a driver or module repository, ensure that the create-tag-and-image workflow has been executed, followed by a manual trigger of the Jenkins job 'CSM-Images-Build-Nightly'. Once the Jenkins image build job is successful, the release-image workflow can be manually triggered to publish the image to quay.io. here is the example for the csi-powerscale repo: - -```yaml -name: Release CSI-Powerscale 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: dell/common-github-actions/.github/workflows/release-image.yaml@main - name: Release Image - with: - version: ${{ needs.process-inputs.outputs.processedVersion }} - images: 'csi-isilon' - secrets: inherit -``` - -### 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: - -```yaml -name: Release CSI-Powerscale -# 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 -jobs: - csm-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.option }} - images: csi-powerscale - 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-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 + option: ${{ inputs.option || 'minor' }} + version: ${{ inputs.version || '' }} secrets: inherit ``` @@ -457,7 +258,7 @@ name: UBI Image Update on: workflow_dispatch: - + jobs: ubi-version-update: uses: dell/common-github-actions/.github/workflows/ubi-version-update.yaml@main @@ -517,7 +318,7 @@ Below is the example usage in csm-operator repository. It expects a script to be present in the csm-operator repository ".github/scripts/operator-version-update.sh". -Make sure to update all the latest versions before you trigger this workflow +Make sure to update all the latest versions before you trigger this workflow Workflow needs to be triggered manually from csm-operator repository. Below is the example usage in csm-operator repository. Example: @@ -636,7 +437,7 @@ Below is the example usage in csm-operator repository. It expects a script to be present in the csm-operator repository ".github/scripts/module-version-update.sh". -Make sure to update all the latest versions before you trigger this workflow +Make sure to update all the latest versions before you trigger this workflow Workflow needs to be triggered manually from csm-operator repository. Below is the example usage in csm-operator repository. Example: @@ -696,7 +497,7 @@ Below is the example usage in csm-operator repository. It expects a script to be present in the csm-operator repository ".github/scripts/driver-version-update.sh". -Make sure to update all the latest versions before you trigger this workflow +Make sure to update all the latest versions before you trigger this workflow Workflow needs to be triggered manually from csm-operator repository. Below is the example usage in csm-operator repository. Example: