diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c23ee3a8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +# Copyright lowRISC contributors (OpenTitan project). +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +name: DVSim Release +on: + push: + branches: + - master + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Repository checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install python-semantic-release package + run: python3 -m pip install python-semantic-release + + - name: Versioning and Publishing the release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + semantic-release version --no-changelog + semantic-release publish diff --git a/pyproject.toml b/pyproject.toml index 68cd9786..5467585b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,3 +104,19 @@ ignore = [ [tool.pytest.ini_options] addopts = "--cov=dvsim --cov-report term-missing" norecursedirs = ["*.egg", ".*", "_darcs", "build", "dist", "venv", "scratch", "doc"] + +[tool.semantic_release] +commit_parser = "conventional" +version_toml = ["pyproject.toml:project.version"] +commit_message = "Bump v{version}" + +[tool.semantic_release.commit_parser_options] +minor_tags = ["feat"] +patch_tags = ["fix", "perf", "refactor"] +parse_squash_commits = true +ignore_merge_commits = true + +[tool.semantic_release.branches.main] +match = "master" +prerelease_token = "rc" +prerelease = false