Skip to content

Commit

Permalink
Fix/auto release (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAuriau authored Jun 4, 2024
1 parent 8257c14 commit 842ddf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
7 changes: 5 additions & 2 deletions .github/actions/publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 3 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[project]
requires-python = ">=3.9"

[tool.ruff]
select = [
"E",
Expand All @@ -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",
Expand Down Expand Up @@ -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"]

0 comments on commit 842ddf5

Please sign in to comment.