Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions .github/workflows/create-tag-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
129 changes: 0 additions & 129 deletions .github/workflows/csm-release-driver-module.yaml

This file was deleted.

23 changes: 19 additions & 4 deletions .github/workflows/csm-release-libs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
79 changes: 79 additions & 0 deletions .github/workflows/process-inputs.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading