xtask: Don't look for pre-release titles in changelogs

This commit is contained in:
Jonas Platte 2021-04-17 19:18:01 +02:00
parent 309ba18b82
commit 83e4c29603
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@ publish = false
default = ["isahc", "semver", "toml_edit"]
[dependencies]
assign = "1.1.1"
isahc = { version = "1.2.0", features = ["json"], optional = true }
semver = { version = "0.11.0", features = ["serde"], optional = true }
serde = { version = "1.0.118", features = ["derive"] }

View File

@ -1,5 +1,6 @@
use std::path::PathBuf;
use assign::assign;
use isahc::{HttpClient, ReadResponseExt};
use semver::Version;
use serde::{de::IgnoredAny, Deserialize};
@ -83,9 +84,10 @@ impl Package {
changelog_path.set_file_name("CHANGELOG.md");
let changelog = read_file(&changelog_path)?;
let version = assign!(self.version.clone(), { pre: vec![], build: vec![] });
if !changelog.starts_with(&format!("# {}\n", self.version))
&& !changelog.starts_with(&format!("# {} (unreleased)\n", self.version))
if !changelog.starts_with(&format!("# {}\n", version))
&& !changelog.starts_with(&format!("# {} (unreleased)\n", version))
&& !changelog.starts_with("# [unreleased]\n")
{
return Err("Could not find version title in changelog".into());