feat(preset): add build and publish tasks
This commit is contained in:
@@ -13,6 +13,14 @@ commands = ["npm install --legacy-peer-deps"]
|
||||
conditions = ["file(node_modules/jest)"]
|
||||
commands = ["npx jest"]
|
||||
|
||||
[presets.nodejs.tasks.build.npm]
|
||||
conditions = ["file(package.json) | get(scripts.build)"]
|
||||
commands = ["npm run build"]
|
||||
|
||||
[presets.nodejs.tasks.publish.npm]
|
||||
conditions = ["file(package.json) | get(scripts.publish)"]
|
||||
commands = ["npm run publish"]
|
||||
|
||||
[presets.nodejs.tasks.clean.node_modules]
|
||||
conditions = ["file(node_modules)"]
|
||||
commands = ["rm -rf node_modules"]
|
||||
|
||||
@@ -8,6 +8,20 @@ conditions = [
|
||||
variables.python_version = "file(pyproject.toml) | get(tool.poetry.dependencies.python) | search((\\d.\\d))"
|
||||
commands = ["poetry env use {python_version}", "poetry install"]
|
||||
|
||||
[presets.python.tasks.build.poetry]
|
||||
conditions = [
|
||||
"file(pyproject.toml) | get(build-system.build-backend) | equal(poetry.core.masonry.api)",
|
||||
]
|
||||
commands = ["poetry build"]
|
||||
|
||||
[presets.python.tasks.publish.poetry]
|
||||
conditions = [
|
||||
"file(pyproject.toml) | get(build-system.build-backend) | equal(poetry.core.masonry.api)",
|
||||
"file(poetry.toml)",
|
||||
]
|
||||
variables.python_repository = "file(poetry.toml) | get(repositories) | key(0)"
|
||||
commands = ["poetry publish -r {python_repository}"]
|
||||
|
||||
[presets.python.tasks.test.pytest]
|
||||
conditions = ["file(.venv/bin/pytest)"]
|
||||
commands = [".venv/bin/pytest -p no:warnings"]
|
||||
|
||||
Reference in New Issue
Block a user