From 842ddf51bdfedd15e6b8677f22cc9ea71eb120ab Mon Sep 17 00:00:00 2001 From: Vincent Auriau Date: Tue, 4 Jun 2024 11:30:56 +0200 Subject: [PATCH] Fix/auto release (#96) --- .github/actions/publish/action.yaml | 7 ++++-- pyproject.toml | 35 +++-------------------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/.github/actions/publish/action.yaml b/.github/actions/publish/action.yaml index 8f03fa45..087a86d0 100644 --- a/.github/actions/publish/action.yaml +++ b/.github/actions/publish/action.yaml @@ -84,8 +84,11 @@ runs: - name: Set GitHub Tag as Package Version run: | - sed -i -r 's/__version__ *= *".*"/__version__ = "${{ github.event.release.tag_name }}"/g' ${{ inputs.PACKAGE_DIRECTORY }}__init__.py - sed -i '0,/version =.*/s//version = "'"${{ github.event.release.tag_name }}"'"/' ./pyproject.toml + vname="${{ github.event.release.tag_name }}" + vname=${vname:1} + echo $vname + sed -i -r 's/__version__ *= *".*"/__version__ = "$vname" /g' ${{ inputs.PACKAGE_DIRECTORY }}__init__.py + sed -i '0,/version =.*/s//version = "'"$vname"'"/' ./pyproject.toml shell: bash - name: Add and Commit Version diff --git a/pyproject.toml b/pyproject.toml index 7bbae3b2..ed5550d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +[project] +requires-python = ">=3.9" + [tool.ruff] select = [ "E", @@ -15,7 +18,6 @@ select = [ ] # See: https://beta.ruff.rs/docs/rules/ ignore = ["D203", "D213", "ANN101", "ANN102", "ANN204", "ANN001", "ANN202", "ANN201", "ANN206", "ANN003", "PTH100", "PTH118", "PTH123"] line-length = 100 -target-version = "py310" exclude = [ ".bzr", ".direnv", @@ -105,34 +107,3 @@ nbstripout = "^0.7" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" - -[tool.semantic_release] -version_variables = ["choice_learn/__init__.py:__version__"] -version_toml = ["pyproject.toml:tool.poetry.version"] -branch = "main" -upload_to_pypi = false -upload_to_release = true -build_command = "pip install poetry && poetry build" -commit_message = "chore(release): {version}\n\n[skip ci]\nAutomatically generated by semantic-release" -tag_format = "{version}" - -[tool.semantic_release.changelog] -exclude_commit_patterns = ['''^chore\(release\).*'''] - -[tool.semantic_release.commit_parser_options] -allowed_tags = [ - "ADD", - "BUILD", - "CHORE", - "CI", - "DOC", - "ENH", - "FEAT", - "FIX", - "PERF", - "STYLE", - "REFAC", - "TEST", -] -minor_tags = ["FEAT"] -patch_tags = ["ADD", "BUILD", "ENH", "FIX", "PERF"]