MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / package_release_assets

Function package_release_assets

xtask/src/main.rs:976–1010  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

974}
975
976fn package_release_assets() -> Result<()> {
977 let output_dir = Path::new(RELEASE_ASSET_BUNDLE_DIR);
978 if output_dir.exists() {
979 fs::remove_dir_all(output_dir)
980 .with_context(|| format!("remove {}", output_dir.display()))?;
981 }
982 fs::create_dir_all(output_dir).with_context(|| format!("create {}", output_dir.display()))?;
983
984 let mut bundles = Vec::new();
985 bundles.push(package_release_portable_assets(output_dir)?);
986 for target in supported_aot_targets() {
987 bundles.push(package_release_aot_assets(output_dir, target)?);
988 }
989
990 let mut checksum_lines = Vec::new();
991 for bundle in &bundles {
992 let name = bundle
993 .file_name()
994 .and_then(|name| name.to_str())
995 .ok_or_else(|| {
996 anyhow!(
997 "release asset path is not valid UTF-8: {}",
998 bundle.display()
999 )
1000 })?;
1001 checksum_lines.push(format!("{} {name}", sha256_file(bundle)?));
1002 }
1003 checksum_lines.sort();
1004 let checksum_path = output_dir.join("pglite-oxide-release-assets.sha256");
1005 fs::write(&checksum_path, format!("{}\n", checksum_lines.join("\n")))
1006 .with_context(|| format!("write {}", checksum_path.display()))?;
1007
1008 println!("packaged public release assets in {}", output_dir.display());
1009 Ok(())
1010}
1011
1012fn package_release_portable_assets(output_dir: &Path) -> Result<PathBuf> {
1013 let generated_assets = Path::new(GENERATED_ASSETS_DIR);

Callers 1

releaseFunction · 0.85

Calls 5

supported_aot_targetsFunction · 0.85
pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected