diff --git a/.gitignore b/.gitignore index 8be01da..0dbb5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target .vscode/ Cargo.lock +.release-tested diff --git a/Makefile.toml b/Makefile.toml index c898fcb..cef1e58 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,113 +1,38 @@ +extend = "build-tools/makefile.toml" + [env] CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true - __FIELDX_DEFAULT_TOOLCHAIN__ = { value = "nightly", condition = { env_not_set = ["__FIELDX_DEFAULT_TOOLCHAIN__"] } } - __FIELDX_TASK__ = { value = "test", condition = { env_not_set = ["__FIELDX_TASK__"] } } - __FIELDX_TOOLCHAINS__ = "1.77 1.78 stable beta nightly" + __MAKE_README_CRATE_ROOT__ = "core" + __MAKE_TEST_TASKS__ = "test-default test-serde test-send_guard test-all-features" + __MAKE_TOOLCHAINS__ = "1.77 1.78 stable beta nightly" [config] default_to_workspace = false -[tasks.test] - category = "Test" - clear = true - dependencies = ["test-default", "test-serde", "test-send_guard", "test-all-features"] - description = "Extensive testing" - -[tasks.test-versions] - description = "TESTING SUPPORTED Rust VERSIONS" - script = ''' -toolchain_list = array %{__FIELDX_TOOLCHAINS__} - -for toolchain in ${toolchain_list} - echo Testing toolchain '${toolchain}' - set_env __FIELDX_DEFAULT_TOOLCHAIN__ ${toolchain} - rm Cargo.lock - cm_run_task ${__FIELDX_TASK__} -end -''' - script_runner = "@duckscript" - -[tasks.update-versions] - description = "Updating .stderr for all versions" - env = { TRYBUILD = "overwrite", __FIELDX_TASK__ = "test-compilation" } - run_task = { name = ["test-versions"] } - [tasks.test-default] args = ["test", "--workspace"] category = "Test" command = "cargo" description = "Test with only the default features" - toolchain = "${__FIELDX_DEFAULT_TOOLCHAIN__}" + toolchain = "${__MAKE_DEFAULT_TOOLCHAIN__}" [tasks.test-serde] args = ["test", "--workspace", "--features", "serde"] category = "Test" command = "cargo" description = "Test with 'serde' feature" - toolchain = "${__FIELDX_DEFAULT_TOOLCHAIN__}" + toolchain = "${__MAKE_DEFAULT_TOOLCHAIN__}" [tasks.test-send_guard] args = ["test", "--workspace", "--features", "send_guard"] category = "Test" command = "cargo" description = "Test with 'serde' feature" - toolchain = "${__FIELDX_DEFAULT_TOOLCHAIN__}" + toolchain = "${__MAKE_DEFAULT_TOOLCHAIN__}" [tasks.test-all-features] args = ["test", "--workspace", "--all-features"] category = "Test" command = "cargo" description = "Test with all features enabled" - toolchain = "${__FIELDX_DEFAULT_TOOLCHAIN__}" - -[tasks.test-compilation] - description = "Run only the compilation test" - script = ''' -echo Skipping compilation test for ${__FIELDX_DEFAULT_TOOLCHAIN__} in ${CARGO_MAKE_WORKING_DIRECTORY} -''' - script_runner = "@duckscript" - workspace = true - -[tasks.depends] - description = "Install necessary dependencies and tools" - script = ''' -echo "Installing dependencies" -exec cargo install cargo-readme -''' - script_runner = "@duckscript" - -[tasks.doc] - description = "Build documentation" - script = ''' -readme_content = exec --fail-on-error cargo readme -r core --template ../README.tpl -writefile ./README.md ${readme_content.stdout} -''' - script_runner = "@duckscript" - -[tasks.publish] - clear = true - dependencies = ["test-versions", "doc"] - description = "Publish on crates.io" - script = ''' -print -bgc red -c black " ► " -print -bgc black -c white " Do you want to publish the crates? " -print -s bold "(y/N)" -echo " " -reply = read -reply = lowercase ${reply} -if eq ${reply} "y" - exec --fail-on-error cargo release -x --no-confirm -else - echo "Won't publish." -end -''' - script_runner = "@duckscript" - -[tasks.pre-release] - clear = true - description = "Produce CHANGELOG.md" - script = """ -cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY} -exec --fail-on-error git cliff -o CHANGELOG.md --tag ${CARGO_RELEASE_VERSION} -""" - script_runner = "@duckscript" + toolchain = "${__MAKE_DEFAULT_TOOLCHAIN__}" diff --git a/README.tpl b/README.tpl deleted file mode 100644 index e322b17..0000000 --- a/README.tpl +++ /dev/null @@ -1,11 +0,0 @@ -[![Rust](https://github.com/vrurg/fieldx/actions/workflows/fieldx.yml/badge.svg)](https://github.com/vrurg/fieldx/actions/workflows/fieldx.yml) -![License](https://img.shields.io/github/license/vrurg/fieldx) -![Crates.io Version](https://img.shields.io/crates/v/fieldx) - -# {{crate}} v{{version}} - -{{readme}} - -# License - -Licensed under [the BSD 3-Clause License](/LICENSE). \ No newline at end of file diff --git a/build-tools b/build-tools index bcfc45b..ce19240 160000 --- a/build-tools +++ b/build-tools @@ -1 +1 @@ -Subproject commit bcfc45b57b46dcc03e5dd5e4bbd224e894e086ed +Subproject commit ce1924030cac31af8f72bbacdce3dd248b0826ba diff --git a/release.toml b/release.toml deleted file mode 100644 index e9bcc37..0000000 --- a/release.toml +++ /dev/null @@ -1,23 +0,0 @@ -allow-branch = [ - "main", - "!HEAD", -] -sign-commit = true -sign-tag = true -push-remote = "origin" -release = true -publish = true -verify = true -owners = [] -push = true -push-options = [] -consolidate-commits = false -pre-release-commit-message = "chore: Release {{crate_name}} version {{version}}" -pre-release-replacements = [] -tag-message = "chore: Release {{crate_name}} version {{version}}" -tag-name = "{{prefix}}v{{version}}" -tag = true -enable-features = [] -enable-all-features = true -dependent-version = "upgrade" -metadata = "optional"