Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added driver release action #389

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Auto Release CSM
on:

Check warning on line 2 in .github/workflows/auto-release.yaml

View workflow job for this annotation

GitHub Actions / Golang Validation / Yaml Lint

2:1 [truthy] truthy value should be one of [false, true]
workflow_dispatch:
repository_dispatch:
types: [auto-driver-module-release-workflow]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dispatch type is 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

Check warning on line 16 in .github/workflows/auto-release.yaml

View workflow job for this annotation

GitHub Actions / Golang Validation / Yaml Lint

16:26 [comments] too few spaces before comment

- 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-powermax"
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release CSI-Powermax
# Invocable as a reusable workflow
# Can be manually triggered
on: # yamllint disable-line rule:truthy

Check warning on line 4 in .github/workflows/release.yaml

View workflow job for this annotation

GitHub Actions / Golang Validation / Yaml Lint

4:5 [comments] too few spaces before comment
workflow_call:
workflow_dispatch:
inputs:
version:
description: 'Version to release (major, minor, patch), Example: 1.x.x'
required: true
image:
description: 'Image name. Example: csi-powermax'
default: 'csi-powermax'
required: true
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.version }}
image: ${{ github.event.inputs.image }}
secrets: inherit
Loading