diff --git a/Cargo.lock b/Cargo.lock index de7a070..042ecbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "atrinik-protocol" -version = "0.2.0" +version = "0.2.1" dependencies = [ "bytes", "idna", @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.14.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" +checksum = "3ef0b569d1d907ab3a28596aee62cf1f61dacb0529a4bedcd8e7460e2d5228b4" dependencies = [ "bytes", "prost-derive", @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.14.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" +checksum = "1ad9c5423459fa2f729b8d9235fab810aa29628b171467744fc86d21460ad70d" dependencies = [ "anyhow", "itertools", diff --git a/Cargo.toml b/Cargo.toml index b5353fb..107c3ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" license = "MIT" repository = "https://github.com/atrinik/protocol" rust-version = "1.97.1" -version = "0.2.0" +version = "0.2.1" [workspace.dependencies] bytes = "1.12.1" diff --git a/policy/rust-crate-candidate.json b/policy/rust-crate-candidate.json index 4b60a8d..4230e1e 100644 --- a/policy/rust-crate-candidate.json +++ b/policy/rust-crate-candidate.json @@ -1,8 +1,8 @@ { "schema_version": 1, "name": "atrinik-protocol", - "version": "0.2.0", + "version": "0.2.1", "base_published_version": "0.1.0", "status": "unpublished", - "publication": "reviewed-manual-publication" + "publication": "reviewed-automatic-publication" } diff --git a/tools/crate_publication.py b/tools/crate_publication.py index 0677f61..f554602 100644 --- a/tools/crate_publication.py +++ b/tools/crate_publication.py @@ -141,7 +141,7 @@ def verify_release_inventory(value, tag): require(listed == expected, 'release checksums do not cover exact asset inventory') -def verify_crate(path, revision, inventory): +def verify_crate(path, revision, inventory, version=VERSION): with (tarfile.open(fileobj=io.BytesIO(path), mode='r:gz') if isinstance(path, bytes) else tarfile.open(path, 'r:gz')) as archive: members = [] total = 0 @@ -149,7 +149,7 @@ def verify_crate(path, revision, inventory): total += member.size require(len(members) < 256 and total <= MAX_BYTES, 'crate archive exceeds bound') members.append(member) - prefix = f'{NAME}-{VERSION}/' + prefix = f'{NAME}-{version}/' names = [] for member in members: require(member.isfile() and member.name.startswith(prefix), 'unexpected archive member') @@ -163,7 +163,7 @@ def read(name): require(vcs == {'git': {'sha1': revision}, 'path_in_vcs': 'crates/atrinik-protocol'}, 'crate VCS provenance mismatch') manifest = tomllib.loads(read('Cargo.toml').decode()) package = manifest['package'] - require(package['name'] == NAME and package['version'] == VERSION and package.get('publish') == ['crates-io'], 'crate is not the publishable reviewed version') + require(package['name'] == NAME and package['version'] == version and package.get('publish') == ['crates-io'], 'crate is not the publishable reviewed version') def no_source_override(value): if isinstance(value, dict): require('path' not in value and 'git' not in value, 'unapproved crate dependency source') @@ -176,7 +176,7 @@ def no_source_override(value): no_source_override(manifest.get(key, {})) lock = tomllib.loads(read('Cargo.lock').decode()) for package in lock['package']: - if package['name'] == NAME and package['version'] == VERSION: + if package['name'] == NAME and package['version'] == version: require('source' not in package, 'unexpected root crate source') else: require(package.get('source') == 'registry+https://github.com/rust-lang/crates.io-index', 'unapproved locked dependency source') diff --git a/tools/test_crate_release_policy.py b/tools/test_crate_release_policy.py index 207a849..54896ee 100755 --- a/tools/test_crate_release_policy.py +++ b/tools/test_crate_release_policy.py @@ -83,7 +83,7 @@ def test_rejects_missing_candidate(self) -> None: def test_rejects_reusing_published_version(self) -> None: path = self.root / "Cargo.toml" - path.write_text(path.read_text().replace('version = "0.2.0"', 'version = "0.1.0"')) + path.write_text(path.read_text().replace('version = "0.2.1"', 'version = "0.1.0"')) self.assert_rejected("cannot be relabeled") def test_rejects_policy_drift(self) -> None: diff --git a/tools/validate.sh b/tools/validate.sh index e253f06..9435e07 100755 --- a/tools/validate.sh +++ b/tools/validate.sh @@ -158,11 +158,11 @@ cargo package --locked --offline --allow-dirty \ --manifest-path crates/atrinik-protocol/Cargo.toml \ --target-dir "${protocol_crate_target}" test -s "${protocol_crate_target}/package/${protocol_crate_asset}" -python3 - "${protocol_crate_target}/package/${protocol_crate_asset}" "$(git rev-parse HEAD)" <<'PYTHON' +python3 - "${protocol_crate_target}/package/${protocol_crate_asset}" "$(git rev-parse HEAD)" "${protocol_crate_version}" <<'PYTHON' from pathlib import Path import sys from tools.crate_publication import verify_crate -verify_crate(Path(sys.argv[1]), sys.argv[2], Path("policy/rust-crate-files.txt").read_text().splitlines()) +verify_crate(Path(sys.argv[1]), sys.argv[2], Path("policy/rust-crate-files.txt").read_text().splitlines(), sys.argv[3]) PYTHON protocol_crate_listing=$(mktemp /tmp/atrinik-protocol-crate-files.XXXXXX) protocol_crate_extract=$(mktemp -d /tmp/atrinik-protocol-crate-extract.XXXXXX)