Add new workflow for version bumping and update README

* **README.md**
  - Add instructions for the new workflow
  - Update steps to include Python environment setup and `python semver` installation

* **.github/workflows/ci-version-bump.yml**
  - Add condition to only push version changes on main branch runs
  - Add step to comment on the next version to publish after a PR merge

* **renovate.json**
  - Update to include chart version bumping
This commit is contained in:
a5r0n
2024-10-17 21:39:19 +03:00
parent 6ccee1df37
commit 098bec3277
3 changed files with 18 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ jobs:
sed -i "s/^version: .*/version: $NEW_VERSION/" n8n/Chart.yaml
- name: Commit changes
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
@@ -47,6 +48,7 @@ jobs:
git push
- name: Create release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@v1
with:
tag_name: ${{ steps.bump-version.outputs.NEW_VERSION }}
@@ -55,3 +57,10 @@ jobs:
Automated release for version ${{ steps.bump-version.outputs.NEW_VERSION }}
draft: false
prerelease: false
- name: Comment on PR
if: github.event_name == 'pull_request'
run: |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
COMMENT_BODY="Next version to publish after this PR is merged: $NEW_VERSION"
gh pr comment $PR_NUMBER --body "$COMMENT_BODY"

View File

@@ -52,14 +52,17 @@ A new workflow has been added to automate chart version bump and release. The wo
* Bumps patch version on n8n major/minor and patch for n8n patch versions.
* Bumps minor version for template changes.
* Only pushes version changes on main branch runs.
* Comments on the next version to publish after a PR merge.
The workflow is triggered on push and pull request events to the `main` branch. It performs the following steps:
1. Checks out the code.
2. Sets up Node.js environment.
3. Installs dependencies.
2. Sets up Python environment.
3. Installs `python semver`.
4. Bumps the chart version based on changes.
5. Commits the changes.
6. Creates a release.
7. Comments on the next version to publish after a PR merge.
The version bumping is done for the Helm chart version, not for a Node.js package.

View File

@@ -22,6 +22,10 @@
{
"matchPaths": ["n8n/templates/**/*.yaml"],
"bumpVersion": "minor"
},
{
"matchPaths": ["n8n/Chart.yaml"],
"bumpVersion": "patch"
}
]
}