Skip to content
Merged
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
145 changes: 145 additions & 0 deletions .github/workflows/version-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: "Automated Version Update"

on:
workflow_dispatch:
inputs:
version:
description: 'New version (X.Y.Z format, without v prefix)'
required: true
type: string
create_draft:
description: 'Create draft PR'
required: false
type: boolean
default: false

env:
NEW_VERSION: ${{ github.event.inputs.version }}

jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Validate version format
run: |
if [[ ! "${{ env.NEW_VERSION }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Invalid version format: ${{ env.NEW_VERSION }}"
echo "Version must be in X.Y.Z format (e.g., 1.2.3)"
exit 1
fi
echo "✅ Version format is valid: ${{ env.NEW_VERSION }}"

- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Create update branch
run: |
BRANCH_NAME="chore/update-version-${{ env.NEW_VERSION }}"
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
git checkout -b "${BRANCH_NAME}"

- name: Run make set_version
run: |
echo "🔄 Running make set_version VERSION=${{ env.NEW_VERSION }}"
make set_version VERSION=${{ env.NEW_VERSION }}
echo "✅ Version update completed"

- name: Check for changes
id: check_changes
run: |
if git diff --quiet; then
echo "No changes detected after running make set_version"
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected:"
git diff --name-only
echo "changes=true" >> $GITHUB_OUTPUT
fi

- name: Commit changes
if: steps.check_changes.outputs.changes == 'true'
run: |
git add .
git commit -m "chore: update version to ${{ env.NEW_VERSION }}

- Updated version references across multiple files
- Generated by automated workflow

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

- name: Push branch
if: steps.check_changes.outputs.changes == 'true'
run: |
git push origin "${{ env.BRANCH_NAME }}"

- name: Create Pull Request
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.BRANCH_NAME }}
base: main
title: "chore: update version to v${{ env.NEW_VERSION }}"
body: |
## 🚀 Automated Version Update

This PR updates the project version from the current version to **v${{ env.NEW_VERSION }}**.

### 📝 Changes Made

The following files have been updated by running `make set_version VERSION=${{ env.NEW_VERSION }}`:

- 📄 `Makefile` - Updated VERSION variable
- 🔧 `config/manager/kustomization.yaml` - Updated image tags
- 🔧 `config/samples/kustomization.yaml` - Updated image tags
- ⚙️ `config/samples/config.yaml` - Updated daemon image version
- 🔄 `.github/workflows/*.yaml` - Updated workflow image versions
- 📖 `README.md` - Updated documentation examples
- 🐳 Various Dockerfiles and configuration files

### 🤖 Automation Details

- **Triggered by**: @${{ github.actor }}
- **Workflow**: `${{ github.workflow }}`
- **Run ID**: `${{ github.run_id }}`

### ✅ Next Steps

1. Review the changes in this PR
2. Merge if everything looks correct
3. Create a new release tag: `v${{ env.NEW_VERSION }}`

---
*This PR was created automatically by GitHub Actions*
draft: ${{ github.event.inputs.create_draft }}
labels: |
chore
release
automated

- name: Summary
if: steps.check_changes.outputs.changes == 'true'
run: |
echo "## 🎉 Version Update Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **New Version**: v${{ env.NEW_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- **Branch**: ${{ env.BRANCH_NAME }}" >> $GITHUB_STEP_SUMMARY
echo "- **Status**: ✅ Pull Request Created" >> $GITHUB_STEP_SUMMARY
echo "- **Draft**: ${{ github.event.inputs.create_draft }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "🔗 [View Pull Request](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pulls)" >> $GITHUB_STEP_SUMMARY

- name: No changes summary
if: steps.check_changes.outputs.changes == 'false'
run: |
echo "## ℹ️ No Changes Required" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The version ${{ env.NEW_VERSION }} is already set in the repository." >> $GITHUB_STEP_SUMMARY
echo "No pull request was created." >> $GITHUB_STEP_SUMMARY
Loading