Skip to content

Commit

Permalink
Merge pull request #33 from qaldak/feature/github-actions
Browse files Browse the repository at this point in the history
build: change semantic release behaviour
  • Loading branch information
qaldak authored Nov 18, 2023
2 parents 0b59be2 + 866efea commit 8164729
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 41 deletions.
37 changes: 1 addition & 36 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,42 +22,6 @@ jobs:
contents: write

steps:
- name: Regex Match
uses: actions-ecosystem/[email protected]
id: regex
with:
text: ${{ github.event.head_commit.message }}
regex: '/[0-9]+\.[0-9]+\.[0-9]+/.*'

- name: Deploy
if: steps.regex.outputs.matched == 'true'
run: |
echo "Foobar!"
- 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:
Expand Down
15 changes: 10 additions & 5 deletions semantic-release.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand All @@ -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"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf", "refactor", "chore"]

0 comments on commit 8164729

Please sign in to comment.