feat: add version task

This commit is contained in:
2026-09-14 22:53:35 +03:00
parent 5401f04485
commit 2df0dc762f
9 changed files with 56 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
[presets.git]
conditions = ["{{ '.git/config' | file }}"]
[presets.git.tasks.version.git]
priority = -1
conditions = ["{{ version }}"]
commands = [
"git add .",
"git commit -m 'ci(version): {{ version }}'",
"git tag '{{ version }}'",
]
@@ -0,0 +1,5 @@
[presets.'*']
priority = 1000
conditions = ["{{ true }}"]
variables.version = "{{ 'version' | env }}"
tasks = {}
@@ -1,26 +1,37 @@
[presets.nodejs]
conditions = ["{{ 'package.json' | file }}"]
# install
[presets.nodejs.tasks.setup.npm]
conditions = ["{{ 'package-lock.json' | file }}"]
commands = ["npm install-clean"]
# install legacy
[presets.nodejs.tasks.setup.npm-legacy]
conditions = ["{{ not ('package-lock.json' | file) }}"]
commands = ["npm install"]
# test
[presets.nodejs.tasks.test.jest]
conditions = ["{{ 'node_modules/jest' | file }}"]
commands = ["npx jest"]
# build
[presets.nodejs.tasks.build.npm]
conditions = ["{{ 'package.json' | read | get('scripts.build') }}"]
commands = ["npm run build"]
# publish
[presets.nodejs.tasks.publish.npm]
conditions = ["{{ 'package.json' | read | get('scripts.publish') }}"]
commands = ["npm run publish"]
# clean
[presets.nodejs.tasks.clean.node_modules]
conditions = ["{{ 'node_modules' | file }}"]
commands = ["rm -rf node_modules"]
# version
[presets.nodejs.tasks.version.npm]
conditions = ["{{ version }}"]
commands = ["npm version {{ version }} --allow-same-version"]
@@ -53,3 +53,8 @@ commands = [".venv/bin/black ./"]
[presets.python.tasks.clean.venv]
conditions = ["{{ '.venv' | file }}"]
commands = ["rm -rf .venv"]
# version
[presets.python.tasks.version.poetry]
conditions = ["{{ python_poetry and version }}"]
commands = ["poetry version {{ version }}"]