Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add main and PR version workflows for semantic versioning and release…
… management
  • Loading branch information
sarbagyastha committed Apr 22, 2025
commit 84d4dc0822eecd52eb9a170509917180fd121e19
1 change: 0 additions & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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: [email protected]

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/[email protected]
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/[email protected]
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 }}
41 changes: 41 additions & 0 deletions .github/workflows/pr-version.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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: