From db74bf1692e2a0669113fe6254d17c4a677eda08 Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar Date: Tue, 22 Apr 2025 21:40:22 +0545 Subject: [PATCH 1/6] Remove automatic CHANGELOG update and branch push from CI workflow --- .github/workflows/dev.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 13c0c4f..31e026b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -60,15 +60,3 @@ jobs: draft: false prerelease: false commit: ${{ steps.versioning.outputs.current_commit }} - - - name: Update CHANGELOG & update develop branch - run: | - git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" - git config --global user.email "${{ env.CI_COMMIT_AUTHOR }}" - changelog='${{ steps.changelog.outputs.changelog }}' - escaped_changelog=$(printf '%s\n' "$changelog" | sed 's/\\/&&/g;s/^[[:blank:]]/\\&/;s/$/\\/') - sed -i "2i ${escaped_changelog%?}" CHANGELOG.md - sed -i "2i ## ${{ steps.versioning.outputs.version_tag }} - $(date +'%d-%m-%Y')" CHANGELOG.md - git add -A && git commit -m "chore(docs): update CHANGELOG.MD" - git push origin main - git push --force origin main:develop From cb9dd76f1433e5f688220203c6e94f951b44117b Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar Date: Tue, 22 Apr 2025 21:40:39 +0545 Subject: [PATCH 2/6] Remove CHANGELOG.md file --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 39a5c90..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# CHANGELOG.md \ No newline at end of file From 1f5593d8fed6974696011575b191eb9690ae640e Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar Date: Tue, 22 Apr 2025 21:51:57 +0545 Subject: [PATCH 3/6] Add fetchReviewers option to changelog generation step --- .github/workflows/dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 31e026b..fe55599 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -49,6 +49,7 @@ jobs: with: fromTag: v${{ steps.versioning.outputs.previous_version }} toTag: ${{ steps.tag_version.outputs.new_tag }} + fetchReviewers: true - name: Create production release uses: ncipollo/release-action@v1 From b719e06565ecfb5b449d2f568b90814fadd14e4b Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar Date: Tue, 22 Apr 2025 22:01:49 +0545 Subject: [PATCH 4/6] Update versioning configuration for prerelease tagging and namespace --- .github/workflows/dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index fe55599..332703e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -31,9 +31,9 @@ jobs: major_pattern: "(MAJOR)" minor_pattern: "(MINOR)" version_format: "${major}.${minor}.${patch}-rc${increment}" - user_format_type: "csv" bump_each_commit: false search_commit_body: true + namespace: "rc" - name: Bump version and push tag id: tag_version @@ -59,5 +59,5 @@ jobs: name: ${{ steps.versioning.outputs.version_tag }} body: ${{ steps.changelog.outputs.changelog }} draft: false - prerelease: false + prerelease: true commit: ${{ steps.versioning.outputs.current_commit }} From 84d4dc0822eecd52eb9a170509917180fd121e19 Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar Date: Tue, 22 Apr 2025 22:21:30 +0545 Subject: [PATCH 5/6] Add main and PR version workflows for semantic versioning and release management --- .github/workflows/dev.yml | 1 - .github/workflows/main.yml | 62 ++++++++++++++++++++++++++++++++ .github/workflows/pr-version.yml | 41 +++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/pr-version.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 332703e..56489f2 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -33,7 +33,6 @@ jobs: version_format: "${major}.${minor}.${patch}-rc${increment}" bump_each_commit: false search_commit_body: true - namespace: "rc" - name: Bump version and push tag id: tag_version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5394a79 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,62 @@ +name: Main + +on: + push: + branches: + - main + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CI_COMMIT_MESSAGE: Deployment by CI + CI_COMMIT_AUTHOR: ci@acmesoftware.com + +jobs: + dev: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Perform semantic version + uses: paulhatch/semantic-version@v5.4.0 + id: versioning + with: + tag_prefix: "v" + major_pattern: "(MAJOR)" + minor_pattern: "(MINOR)" + version_format: "${major}.${minor}.${patch}-rc${increment}" + bump_each_commit: false + search_commit_body: true + + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + custom_tag: ${{ steps.versioning.outputs.version_tag }} + tag_prefix: "" + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Changelog + id: changelog + uses: mikepenz/release-changelog-builder-action@v5 + with: + fromTag: v${{ steps.versioning.outputs.previous_version }} + toTag: ${{ steps.tag_version.outputs.new_tag }} + fetchReviewers: true + + - name: Create production release + uses: ncipollo/release-action@v1 + id: release + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: ${{ steps.versioning.outputs.version_tag }} + body: ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false + commit: ${{ steps.versioning.outputs.current_commit }} diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml new file mode 100644 index 0000000..0c27d84 --- /dev/null +++ b/.github/workflows/pr-version.yml @@ -0,0 +1,41 @@ +on: + pull_request_target: + types: + - opened + branches: + - main + - develop + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + pr-version: + runs-on: ubuntu-latest + + permissions: + pull-requests: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: "refs/pull/${{ github.event.number }}/merge" + fetch-depth: 0 + + - name: Perform semantic version + uses: paulhatch/semantic-version@v5.4.0 + id: versioning + with: + tag_prefix: "v" + major_pattern: "(MAJOR)" + minor_pattern: "(MINOR)" + version_format: "${major}.${minor}.${patch}-rc${increment}" + bump_each_commit: false + search_commit_body: true + + - name: Comment PR + uses: thollander/actions-comment-pull-request@v3 + with: + message: | + :rocket: The next version will be **${{ steps.versioning.outputs.version_tag }}** ! :rocket: From 79a88ab19397b1bccfbee4300d6c5a29f4ddd2bd Mon Sep 17 00:00:00 2001 From: Sarbagya Dhaubanjar Date: Tue, 22 Apr 2025 22:44:30 +0545 Subject: [PATCH 6/6] Update CI workflows to set namespace for semantic versioning and adjust release settings --- .github/workflows/dev.yml | 3 +-- .github/workflows/main.yml | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 56489f2..1106ec4 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -33,6 +33,7 @@ jobs: version_format: "${major}.${minor}.${patch}-rc${increment}" bump_each_commit: false search_commit_body: true + namespace: "rc" - name: Bump version and push tag id: tag_version @@ -57,6 +58,4 @@ jobs: tag: ${{ steps.tag_version.outputs.new_tag }} name: ${{ steps.versioning.outputs.version_tag }} body: ${{ steps.changelog.outputs.changelog }} - draft: false - prerelease: true commit: ${{ steps.versioning.outputs.current_commit }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5394a79..38c68f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,6 +57,4 @@ jobs: tag: ${{ steps.tag_version.outputs.new_tag }} name: ${{ steps.versioning.outputs.version_tag }} body: ${{ steps.changelog.outputs.changelog }} - draft: false - prerelease: false commit: ${{ steps.versioning.outputs.current_commit }}