-
Notifications
You must be signed in to change notification settings - Fork 20
Update Release Workflow #181
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # 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 create Github Tag and Release | ||
| name: Create Tag and Release | ||
|
KshitijaKakde marked this conversation as resolved.
|
||
| # 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@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "1.24" | ||
|
|
||
| - 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # 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 | ||
|
KshitijaKakde marked this conversation as resolved.
|
||
| 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="delltech/csm" | ||
|
|
||
| for image in $images_list; do | ||
| latest_version=$(curl -s https://quay.io/api/v1/repository/$REPOSITORY/$image/tag/?limit=100 | 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.