From 8051894731402cf33d76e4dfa679c43dcb7d3ea5 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sun, 3 Dec 2023 20:20:48 +0100 Subject: [PATCH] chore: Add version bump workflow --- .cz.toml | 8 ++++++++ .github/workflows/bumb-version.yml | 22 ++++++++++++++++++++++ .github/workflows/upload.yml | 4 +--- version.php | 3 +++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .cz.toml create mode 100644 .github/workflows/bumb-version.yml create mode 100644 version.php diff --git a/.cz.toml b/.cz.toml new file mode 100644 index 0000000..2933811 --- /dev/null +++ b/.cz.toml @@ -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 diff --git a/.github/workflows/bumb-version.yml b/.github/workflows/bumb-version.yml new file mode 100644 index 0000000..3ae9519 --- /dev/null +++ b/.github/workflows/bumb-version.yml @@ -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 }}" \ No newline at end of file diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index 2ebc1cc..81c17a5 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -2,14 +2,12 @@ name: 'Publish to prod' on: push: - branches: - - "main" + tags: v[0-9]+.[0-9]+.[0-9]+ permissions: id-token: write contents: read - jobs: upload-prod: runs-on: ubuntu-latest diff --git a/version.php b/version.php new file mode 100644 index 0000000..54a948d --- /dev/null +++ b/version.php @@ -0,0 +1,3 @@ +