Add new CI version bump workflow and update README

* **.github/workflows/ci-version-bump.yml**
  - Replace Node.js setup with Python setup
  - Install semver using pip
  - Use Python and semver for version bumping instead of npm

* **README.md**
  - Add instructions for the new CI version bump workflow
This commit is contained in:
a5r0n
2024-10-17 21:30:27 +03:00
parent 6292c9eda0
commit 6ccee1df37
2 changed files with 26 additions and 7 deletions

View File

@@ -15,13 +15,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
node-version: '14'
python-version: '3.x'
- name: Install dependencies
run: npm install
- name: Install semver
run: |
pip install semver
- name: Bump version
id: bump-version
@@ -30,9 +31,9 @@ jobs:
N8N_VERSION=$(grep -oP '^appVersion: "\K.*(?=")' n8n/Chart.yaml)
TEMPLATE_CHANGED=$(git diff --name-only HEAD~1 HEAD | grep -E 'n8n/templates/.*\.yaml' || true)
if [[ $TEMPLATE_CHANGED ]]; then
NEW_VERSION=$(npm version minor --no-git-tag-version)
NEW_VERSION=$(python -c "import semver; print(semver.VersionInfo.parse('$CURRENT_VERSION').bump_minor())")
else
NEW_VERSION=$(npm version patch --no-git-tag-version)
NEW_VERSION=$(python -c "import semver; print(semver.VersionInfo.parse('$CURRENT_VERSION').bump_patch())")
fi
echo "New version: $NEW_VERSION"
sed -i "s/^version: .*/version: $NEW_VERSION/" n8n/Chart.yaml

View File

@@ -45,3 +45,21 @@ ingress:
```
see [values.yaml](./n8n/values.yaml)
## CI Version Bump Workflow
A new workflow has been added to automate chart version bump and release. The workflow is defined in the `.github/workflows/ci-version-bump.yml` file and performs the following actions:
* Bumps patch version on n8n major/minor and patch for n8n patch versions.
* Bumps minor version for template changes.
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.
4. Bumps the chart version based on changes.
5. Commits the changes.
6. Creates a release.
The version bumping is done for the Helm chart version, not for a Node.js package.