From 098bec3277a33c15e13857684127702626fa907a Mon Sep 17 00:00:00 2001 From: a5r0n <32464596+a5r0n@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:39:19 +0300 Subject: [PATCH] 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 --- .github/workflows/ci-version-bump.yml | 9 +++++++++ README.md | 7 +++++-- renovate.json | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-version-bump.yml b/.github/workflows/ci-version-bump.yml index b9d8659..03d0a8e 100644 --- a/.github/workflows/ci-version-bump.yml +++ b/.github/workflows/ci-version-bump.yml @@ -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" diff --git a/README.md b/README.md index 77b9150..8dfb82d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/renovate.json b/renovate.json index c4164ed..814ed1a 100644 --- a/renovate.json +++ b/renovate.json @@ -22,6 +22,10 @@ { "matchPaths": ["n8n/templates/**/*.yaml"], "bumpVersion": "minor" + }, + { + "matchPaths": ["n8n/Chart.yaml"], + "bumpVersion": "patch" } ] }