chore: Add version bump workflow

This commit is contained in:
overflowerror 2023-12-03 20:20:48 +01:00
parent 781b400c1e
commit 8051894731
4 changed files with 34 additions and 3 deletions

8
.cz.toml Normal file
View file

@ -0,0 +1,8 @@
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version = "0.1.0"
version_files = [ "version.php:VERSION" ]
update_changelog_on_bump = true
major_version_zero = true

22
.github/workflows/bumb-version.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: 'Bump version'
on:
push:
branches:
- "main"
jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: "actions/checkout@v3"
with:
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
fetch-depth: 0
- name: Create bump and changelog
uses: "commitizen-tools/commitizen-action@master"
with:
github_token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"

View file

@ -2,14 +2,12 @@ name: 'Publish to prod'
on: on:
push: push:
branches: tags: v[0-9]+.[0-9]+.[0-9]+
- "main"
permissions: permissions:
id-token: write id-token: write
contents: read contents: read
jobs: jobs:
upload-prod: upload-prod:
runs-on: ubuntu-latest runs-on: ubuntu-latest

3
version.php Normal file
View file

@ -0,0 +1,3 @@
<?php
const VERSION = "0.1.0";