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
+8 -7
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