From 0607d8fbc627460b581231262a8a68f3e130c325 Mon Sep 17 00:00:00 2001 From: Roger Date: Sat, 18 Nov 2023 11:52:41 +0100 Subject: [PATCH] build: change semantic release behaviour --- .github/workflows/semantic-release.yml | 25 +------------------------ semantic-release.toml | 15 ++++++++++----- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index b1fc217..3f9e4d3 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -13,6 +13,7 @@ jobs: target_workflow: ./.github/workflows/python-tests.yml release: + if: ${{ ! startsWith(github.event.head_commit.message, 'release' ) }} needs: quality runs-on: ubuntu-latest concurrency: release @@ -21,30 +22,6 @@ jobs: contents: write steps: - - name: Not triggered by new release - if: ${{ ! startsWith(github.event.head_commit.message, '/^[0-9]+\.[0-9]+\.[0-9]+/' ) }} - run: | - echo "${{ github.event.head_commit.message }}" - echo "Bar" - - - name: Triggered by new release - if: ${{ startsWith(github.event.head_commit.message, '/^[0-9]+\.[0-9]+\.[0-9]+/' ) }} - run: | - echo "${{ github.event.head_commit.message }}" - echo "Foo" - - - name: Check Tag - id: check-tag - run: | - if [[ "${{ github.event.head_commit.message }}" =~ /[0-9]+\.[0-9]+\.[0-9]+/ ]]; then - echo "::set-output name=match::true" - fi - - - name: Build - if: steps.check-tag.outputs.match == 'true' - run: | - echo "Tag is a match" - - name: Checkout repository uses: actions/checkout@v4 with: diff --git a/semantic-release.toml b/semantic-release.toml index d7a505e..453838d 100644 --- a/semantic-release.toml +++ b/semantic-release.toml @@ -1,4 +1,10 @@ -[tool.semantic_release.branches.main] +[tool.semantic_release] +commit_message = "release: {version}\n\nAutomatically generated by python-semantic-release" + +[tool.semantic_release.changelog] +exclude_commit_patterns = [ + "{version}\n\nAutomatically generated by python-semantic-release" +] [tool.semantic_release.commit_parser_options] allowed_tags = [ @@ -7,13 +13,12 @@ allowed_tags = [ "ci", "docs", "feat", - "feature", "fix", "perf", "style", "refactor", + "release", "test", ] -major_tags = ["feat!", "breaking change", "BREAKING CHANGE"] -minor_tags = ["feat", "feature"] -patch_tags = ["fix", "perf", "refactor"] \ No newline at end of file +minor_tags = ["feat"] +patch_tags = ["fix", "perf", "refactor", "chore"] \ No newline at end of file