diff --git a/.github/workflows/watch.yml b/.github/workflows/watch.yml index 371e7c3..2dbff18 100644 --- a/.github/workflows/watch.yml +++ b/.github/workflows/watch.yml @@ -6,7 +6,7 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OCVW_LINK: https://github.com/darwinia-network/darwinia-release/releases/download/v0.7.0/ocvw.zst + OCVW_LINK: https://github.com/darwinia-network/darwinia-release/releases/download/v0.8.0/ocvw.zst jobs: watch: diff --git a/on-chain-version-watcher/Cargo.lock b/on-chain-version-watcher/Cargo.lock index 11b8d01..3d73751 100644 --- a/on-chain-version-watcher/Cargo.lock +++ b/on-chain-version-watcher/Cargo.lock @@ -140,7 +140,7 @@ dependencies = [ [[package]] name = "ocvw" -version = "0.7.0" +version = "0.8.0" dependencies = [ "anyhow", "regex", diff --git a/on-chain-version-watcher/Cargo.toml b/on-chain-version-watcher/Cargo.toml index e156398..2d82294 100644 --- a/on-chain-version-watcher/Cargo.toml +++ b/on-chain-version-watcher/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "ocvw" -version = "0.7.0" +version = "0.8.0" [dependencies] # crates.io diff --git a/on-chain-version-watcher/src/main.rs b/on-chain-version-watcher/src/main.rs index 9ba51c0..8b5c842 100644 --- a/on-chain-version-watcher/src/main.rs +++ b/on-chain-version-watcher/src/main.rs @@ -124,23 +124,21 @@ impl GitHub { ) -> Result { let api = format!("https://api.github.com/repos/darwinia-network/{repository}/releases"); let releases = self.get::>(&api)?; + let re = if prerelease { + Regex::new(r".*(pango-\d{4})").unwrap() + } else { + Regex::new(r".*(v\d+\.\d+\.\d+(-\d+)?)").unwrap() + }; for r in releases { - let re = if prerelease { - if !r.prerelease { - continue; - } - - Regex::new(r".*(pango-\d{4})").unwrap() - } else { - Regex::new(r".*(v\d+\.\d+\.\d+(-\d+)?)").unwrap() - }; - + if prerelease != r.prerelease { + continue; + } if branch.map_or(true, |b| r.target_commitish == b) { let tag = re .captures(&r.tag_name) .and_then(|c| c.get(1).map(|m| m.as_str())) - .expect("invalid tag name"); + .unwrap_or_else(|| panic!("invalid tag name {}", r.tag_name)); let spec = tag2spec_version(tag, prerelease)?; return Ok(Version { diff --git a/whitelist-upgrade-hasher/Cargo.lock b/whitelist-upgrade-hasher/Cargo.lock index c1784d5..44eec1f 100644 --- a/whitelist-upgrade-hasher/Cargo.lock +++ b/whitelist-upgrade-hasher/Cargo.lock @@ -41,7 +41,7 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "wuh" -version = "0.7.0" +version = "0.8.0" dependencies = [ "array-bytes", "blake2-rfc", diff --git a/whitelist-upgrade-hasher/Cargo.toml b/whitelist-upgrade-hasher/Cargo.toml index 0b6a1fb..f224cfa 100644 --- a/whitelist-upgrade-hasher/Cargo.toml +++ b/whitelist-upgrade-hasher/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "wuh" -version = "0.7.0" +version = "0.8.0" [dependencies] # crates.io