disable-publish = true
disable-push = true
no-dev-version = true
pre-release-commit-message = "v{{version}}"
pre-release-hook = ["cargo", "test", "--all"]
pre-release-replacements = [
    # crypto
    {file="crypto/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="version = \"{{version}}\"\n", exactly=1},
    {file="Cargo.lock", search="dup-crypto\"\nversion = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="dup-crypto\"\nversion = \"{{version}}\"\n", exactly=1},
    # common
    {file="common/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\" }", replace="version = \"{{version}}\" }", exactly=1},
    {file="common/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="version = \"{{version}}\"\n", exactly=1},
    {file="Cargo.lock", search="dubp-common\"\nversion = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="dubp-common\"\nversion = \"{{version}}\"\n", exactly=1},
    # wallet
    {file="wallet/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\" }", replace="version = \"{{version}}\" }", exactly=1},
    {file="wallet/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="version = \"{{version}}\"\n", exactly=1},
    {file="Cargo.lock", search="dubp-wallet\"\nversion = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="dubp-wallet\"\nversion = \"{{version}}\"\n", exactly=1},
    # documents
    {file="documents/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\" }", replace="version = \"{{version}}\" }", exactly=1},
    {file="documents/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="version = \"{{version}}\"\n", exactly=1},
    {file="Cargo.lock", search="dubp-documents\"\nversion = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="dubp-documents\"\nversion = \"{{version}}\"\n", exactly=1},
    # documents-parser
    {file="documents-parser/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\" }", replace="version = \"{{version}}\" }", exactly=1},
    {file="documents-parser/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="version = \"{{version}}\"\n", exactly=1},
    {file="Cargo.lock", search="dubp-documents-parser\"\nversion = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="dubp-documents-parser\"\nversion = \"{{version}}\"\n", exactly=1},
    # block
    {file="block/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\" }", replace="version = \"{{version}}\" }", exactly=2},
    {file="block/Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="version = \"{{version}}\"\n", exactly=1},
    {file="Cargo.lock", search="dubp-block\"\nversion = \"[0-9]+.[0-9]+.[0-9]+\"\n", replace="dubp-block\"\nversion = \"{{version}}\"\n", exactly=1},
    # dubp
    {file="Cargo.toml", search="version = \"[0-9]+.[0-9]+.[0-9]+\",", replace="version = \"{{version}}\",", exactly=6},
    # CHANGELOG
    {file="CHANGELOG.md", search="Unreleased", replace="{{version}}"},
    {file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
    {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}"},
    {file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n\n## [Unreleased] - ReleaseDate"},
    {file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://git.duniter.org/libs/dubp-rs-libs/compare/{{tag_name}}...HEAD", exactly=1},
]
