Skip to content

Commit

Permalink
ci: FRON-26 semantic release via github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Dec 30, 2024
1 parent 509af16 commit 7b42784
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.commitizen]
version = "0.1.0"
version_files = ["package.json:version", "VERSION"]
update_changelog_on_bump = true
major_version_zero = true
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
branches: [main]

jobs:
release:
# create a release following the logic below:
# 1. branch is `main` AND
# 2. workflow is triggered by a push event AND
# 3. the head commit's commit message does NOT starts with `bump:`
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && ! startsWith(github.event.head_commit.message , 'bump:') }}
name: ⬆️ Bump version and create changelog with a GitHub release
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.SVC_PAT }}

- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@ee36ca9396bdc21d6003d1e045bfecf26ad85029
with:
github_token: ${{ secrets.SVC_PAT }}
changelog_increment_filename: body.md

- name: Release
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
with:
body_path: 'body.md'
tag_name: ${{ env.REVISION }} # this is the version set in the previous step
token: ${{ secrets.SVC_PAT }}
generate_release_notes: true
Empty file added CHANGELOG.md
Empty file.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit 7b42784

Please sign in to comment.