mirror of
https://github.com/axodotdev/cargo-dist.git
synced 2025-02-17 01:02:02 +08:00
feat: rename cargo-dist-schema => dist-schema
This commit is contained in:
parent
b1e8366772
commit
6c9a8a8cca
2
.github/workflows/publish-crates.yml
vendored
2
.github/workflows/publish-crates.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
||||
- run: cargo publish -p axoproject --token ${CRATES_TOKEN}
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
|
||||
- run: cargo publish -p cargo-dist-schema --token ${CRATES_TOKEN}
|
||||
- run: cargo publish -p dist-schema --token ${CRATES_TOKEN}
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
|
||||
- run: cargo publish -p dist --token ${CRATES_TOKEN}
|
||||
|
30
Cargo.lock
generated
30
Cargo.lock
generated
@ -378,20 +378,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo-dist-schema"
|
||||
version = "0.28.0"
|
||||
dependencies = [
|
||||
"camino",
|
||||
"gazenot",
|
||||
"insta",
|
||||
"schemars",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"target-lexicon",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo-platform"
|
||||
version = "0.1.8"
|
||||
@ -803,7 +789,6 @@ dependencies = [
|
||||
"base64",
|
||||
"blake2",
|
||||
"camino",
|
||||
"cargo-dist-schema",
|
||||
"cargo-wix",
|
||||
"cargo_metadata",
|
||||
"clap",
|
||||
@ -813,6 +798,7 @@ dependencies = [
|
||||
"console",
|
||||
"current_platform",
|
||||
"dialoguer",
|
||||
"dist-schema",
|
||||
"flate2",
|
||||
"gazenot",
|
||||
"goblin",
|
||||
@ -840,6 +826,20 @@ dependencies = [
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dist-schema"
|
||||
version = "0.28.0"
|
||||
dependencies = [
|
||||
"camino",
|
||||
"gazenot",
|
||||
"insta",
|
||||
"schemars",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"target-lexicon",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dyn-clone"
|
||||
version = "1.0.17"
|
||||
|
@ -17,7 +17,7 @@ rust-version = "1.74"
|
||||
|
||||
[workspace.dependencies]
|
||||
# intra-workspace deps (you need to bump these versions when you cut releases too!
|
||||
cargo-dist-schema = { version = "=0.28.0", path = "cargo-dist-schema" }
|
||||
dist-schema = { version = "=0.28.0", path = "cargo-dist-schema" }
|
||||
axoproject = { version = "=0.28.0", path = "axoproject", default-features = false, features = ["cargo-projects", "generic-projects", "npm-projects"] }
|
||||
|
||||
# first-party deps
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "cargo-dist-schema"
|
||||
name = "dist-schema"
|
||||
description = "Schema information for cargo-dist's dist-manifest.json"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
|
@ -35,7 +35,7 @@ axocli.workspace = true
|
||||
axoupdater.workspace = true
|
||||
|
||||
# Features used by the cli and library
|
||||
cargo-dist-schema.workspace = true
|
||||
dist-schema.workspace = true
|
||||
axoproject.workspace = true
|
||||
|
||||
axotag.workspace = true
|
||||
|
@ -90,7 +90,7 @@ use std::fmt::Display;
|
||||
|
||||
use axoproject::PackageIdx;
|
||||
use axotag::{parse_tag, Package, PartialAnnouncementTag, ReleaseType};
|
||||
use cargo_dist_schema::{DistManifest, GithubHosting, TripleName, TripleNameRef};
|
||||
use dist_schema::{DistManifest, GithubHosting, TripleName, TripleNameRef};
|
||||
use itertools::Itertools;
|
||||
use semver::Version;
|
||||
use tracing::info;
|
||||
@ -884,9 +884,9 @@ pub fn announcement_github(manifest: &mut DistManifest) {
|
||||
|
||||
for (_name, artifact) in manifest.artifacts_for_release(release) {
|
||||
match artifact.kind {
|
||||
cargo_dist_schema::ArtifactKind::ExecutableZip => bundles.push(artifact),
|
||||
cargo_dist_schema::ArtifactKind::Symbols => symbols.push(artifact),
|
||||
cargo_dist_schema::ArtifactKind::Installer => {
|
||||
dist_schema::ArtifactKind::ExecutableZip => bundles.push(artifact),
|
||||
dist_schema::ArtifactKind::Symbols => symbols.push(artifact),
|
||||
dist_schema::ArtifactKind::Installer => {
|
||||
if let (Some(desc), Some(hint)) =
|
||||
(&artifact.description, &artifact.install_hint)
|
||||
{
|
||||
@ -895,10 +895,10 @@ pub fn announcement_github(manifest: &mut DistManifest) {
|
||||
local_installers.push(artifact);
|
||||
}
|
||||
}
|
||||
cargo_dist_schema::ArtifactKind::Checksum => {
|
||||
dist_schema::ArtifactKind::Checksum => {
|
||||
// Do Nothing (will be included with the artifact it checksums)
|
||||
}
|
||||
cargo_dist_schema::ArtifactKind::Unknown => {
|
||||
dist_schema::ArtifactKind::Unknown => {
|
||||
// Do nothing
|
||||
}
|
||||
_ => {
|
||||
@ -1022,7 +1022,7 @@ fn sortable_triple(triple: &TripleNameRef) -> Vec<String> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use cargo_dist_schema::TripleNameRef;
|
||||
use dist_schema::TripleNameRef;
|
||||
|
||||
use super::sortable_triple;
|
||||
#[test]
|
||||
|
@ -7,7 +7,7 @@ use std::collections::BTreeMap;
|
||||
use axoasset::{LocalAsset, SourceFile};
|
||||
use axoprocess::Cmd;
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
target_lexicon::{self, Architecture, OperatingSystem, Triple},
|
||||
AptPackageName, ChocolateyPackageName, ContainerImageRef, GhaRunStep, GithubGlobalJobConfig,
|
||||
GithubLocalJobConfig, GithubMatrix, GithubRunnerConfig, GithubRunnerRef, GithubRunners,
|
||||
@ -66,9 +66,9 @@ pub struct GithubCiInfo {
|
||||
/// Trigger releases on pushes to this branch instead of ci
|
||||
pub release_branch: Option<String>,
|
||||
/// Matrix for upload-local-artifacts
|
||||
pub artifacts_matrix: cargo_dist_schema::GithubMatrix,
|
||||
pub artifacts_matrix: dist_schema::GithubMatrix,
|
||||
/// What kind of job to run on pull request
|
||||
pub pr_run_mode: cargo_dist_schema::PrRunMode,
|
||||
pub pr_run_mode: dist_schema::PrRunMode,
|
||||
/// global task
|
||||
pub global_task: GithubGlobalJobConfig,
|
||||
/// homebrew tap
|
||||
@ -222,7 +222,7 @@ impl GithubCiInfo {
|
||||
let mut dependencies = SystemDependencies::default();
|
||||
|
||||
let caching_could_be_profitable =
|
||||
release_branch.is_some() || pr_run_mode == cargo_dist_schema::PrRunMode::Upload;
|
||||
release_branch.is_some() || pr_run_mode == dist_schema::PrRunMode::Upload;
|
||||
let cache_builds = cache_builds.unwrap_or(caching_could_be_profitable);
|
||||
|
||||
let need_cargo_auditable = dist.config.builds.cargo.cargo_auditable;
|
||||
@ -679,10 +679,10 @@ fn cargo_xwin() -> GithubRunnerConfig {
|
||||
GithubRunnerConfig {
|
||||
runner: GithubRunnerRef::from_str("ubuntu-20.04").to_owned(),
|
||||
host: targets::TARGET_X64_LINUX_GNU.to_owned(),
|
||||
container: Some(cargo_dist_schema::ContainerConfig {
|
||||
container: Some(dist_schema::ContainerConfig {
|
||||
image: ContainerImageRef::from_str("messense/cargo-xwin").to_owned(),
|
||||
host: targets::TARGET_X64_LINUX_MUSL.to_owned(),
|
||||
package_manager: Some(cargo_dist_schema::PackageManager::Apt),
|
||||
package_manager: Some(dist_schema::PackageManager::Apt),
|
||||
}),
|
||||
}
|
||||
}
|
||||
@ -743,7 +743,7 @@ fn system_deps_install_script(
|
||||
// apt-using runners.
|
||||
if rc.container.is_none()
|
||||
|| rc.container.as_ref().and_then(|c| c.package_manager)
|
||||
== Some(cargo_dist_schema::PackageManager::Apt)
|
||||
== Some(dist_schema::PackageManager::Apt)
|
||||
{
|
||||
for (name, pkg) in &packages.apt {
|
||||
if !pkg.0.stage_wanted(&DependencyKind::Build) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! Support for generating CI scripts for running dist
|
||||
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
target_lexicon::{OperatingSystem, Triple},
|
||||
DashScript, GhaRunStep, PowershellScript,
|
||||
};
|
||||
@ -101,7 +101,7 @@ impl DistInstallSettings<'_> {
|
||||
}
|
||||
|
||||
let version = self.version;
|
||||
let format = cargo_dist_schema::format_of_version(version);
|
||||
let format = dist_schema::format_of_version(version);
|
||||
let installer_name = if format.unsupported() {
|
||||
// FIXME: we should probably do this check way higher up and produce a proper err...
|
||||
panic!("requested dist v{version}, which is not supported by the this copy of dist ({SELF_DIST_VERSION})");
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Code for generating formula.rb
|
||||
|
||||
use axoasset::LocalAsset;
|
||||
use cargo_dist_schema::{ChecksumValue, DistManifest, HomebrewPackageName};
|
||||
use dist_schema::{ChecksumValue, DistManifest, HomebrewPackageName};
|
||||
use serde::Serialize;
|
||||
use spdx::{
|
||||
expression::{ExprNode, Operator},
|
||||
|
@ -5,7 +5,7 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::{ArtifactId, EnvironmentVariables, Hosting, TripleName};
|
||||
use dist_schema::{ArtifactId, EnvironmentVariables, Hosting, TripleName};
|
||||
use homebrew::HomebrewFragments;
|
||||
use macpkg::PkgInstallerInfo;
|
||||
use serde::Serialize;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use axoasset::{toml_edit, LocalAsset};
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::TripleName;
|
||||
use dist_schema::TripleName;
|
||||
use tracing::info;
|
||||
use wix::print::{wxs::WxsRenders, RenderOutput};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use axoasset::{LocalAsset, SourceFile};
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{ArtifactId, GlibcVersion, TripleName};
|
||||
use dist_schema::{ArtifactId, GlibcVersion, TripleName};
|
||||
use serde::Serialize;
|
||||
|
||||
use super::InstallerInfo;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Code for generating installer.sh
|
||||
|
||||
use axoasset::LocalAsset;
|
||||
use cargo_dist_schema::DistManifest;
|
||||
use dist_schema::DistManifest;
|
||||
|
||||
use crate::{backend::templates::TEMPLATE_INSTALLER_SH, errors::DistResult, DistGraph};
|
||||
|
||||
|
@ -4,8 +4,8 @@ use std::env;
|
||||
|
||||
use axoprocess::Cmd;
|
||||
use axoproject::WorkspaceIdx;
|
||||
use cargo_dist_schema::target_lexicon::{Architecture, Environment, Triple};
|
||||
use cargo_dist_schema::{DistManifest, TripleName};
|
||||
use dist_schema::target_lexicon::{Architecture, Environment, Triple};
|
||||
use dist_schema::{DistManifest, TripleName};
|
||||
use miette::{Context, IntoDiagnostic};
|
||||
use tracing::warn;
|
||||
|
||||
@ -272,7 +272,7 @@ pub fn build_cargo_target(
|
||||
}
|
||||
|
||||
let auditable = dist_graph.config.builds.cargo.cargo_auditable;
|
||||
let host = cargo_dist_schema::target_lexicon::HOST;
|
||||
let host = dist_schema::target_lexicon::HOST;
|
||||
let mut command =
|
||||
make_build_cargo_target_command(&host, &cargo.cmd, &rustflags, step, auditable)?;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
use axoasset::LocalAsset;
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::DistManifest;
|
||||
use dist_schema::DistManifest;
|
||||
|
||||
use crate::{BinaryIdx, CargoBuildStep, DistGraph, DistResult, GenericBuildStep};
|
||||
|
||||
|
@ -5,7 +5,7 @@ use std::{env, process::ExitStatus};
|
||||
use axoprocess::Cmd;
|
||||
use axoproject::WorkspaceIdx;
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{DistManifest, TripleName, TripleNameRef};
|
||||
use dist_schema::{DistManifest, TripleName, TripleNameRef};
|
||||
|
||||
use crate::{
|
||||
build::{package_id_string, BuildExpectations},
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use axoproject::PackageId;
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::{AssetInfo, DistManifest, TripleNameRef};
|
||||
use dist_schema::{AssetInfo, DistManifest, TripleNameRef};
|
||||
use tracing::info;
|
||||
|
||||
use crate::{
|
||||
@ -207,8 +207,8 @@ impl BuildExpectations {
|
||||
// If we're faking it, don't run the linkage stuff
|
||||
let linkage = if self.fake {
|
||||
// FIXME: fake this more interestingly!
|
||||
let mut linkage = cargo_dist_schema::Linkage::default();
|
||||
linkage.other.insert(cargo_dist_schema::Library {
|
||||
let mut linkage = dist_schema::Linkage::default();
|
||||
linkage.other.insert(dist_schema::Library {
|
||||
path: "fakelib".to_owned(),
|
||||
source: None,
|
||||
package_manager: None,
|
||||
|
@ -1,12 +1,12 @@
|
||||
//! All the clap stuff for parsing/documenting the cli
|
||||
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::TripleName;
|
||||
use clap::{
|
||||
builder::{PossibleValuesParser, TypedValueParser},
|
||||
Args, Parser, Subcommand, ValueEnum,
|
||||
};
|
||||
use dist::announce::{TagMode, TagSettings};
|
||||
use dist_schema::TripleName;
|
||||
use tracing::level_filters::LevelFilter;
|
||||
|
||||
#[derive(Parser, Clone, Debug)]
|
||||
|
@ -5,7 +5,7 @@ use std::collections::BTreeMap;
|
||||
use axoasset::{toml_edit, SourceFile};
|
||||
use axoproject::local_repo::LocalRepo;
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
AptPackageName, ChecksumExtensionRef, ChocolateyPackageName, HomebrewPackageName,
|
||||
PackageVersion, TripleName, TripleNameRef,
|
||||
};
|
||||
@ -175,13 +175,13 @@ impl std::str::FromStr for LibraryStyle {
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum InstallerStyle {
|
||||
/// Generate a shell script that fetches from [`cargo_dist_schema::Release::artifact_download_url`][]
|
||||
/// Generate a shell script that fetches from [`dist_schema::Release::artifact_download_url`][]
|
||||
Shell,
|
||||
/// Generate a powershell script that fetches from [`cargo_dist_schema::Release::artifact_download_url`][]
|
||||
/// Generate a powershell script that fetches from [`dist_schema::Release::artifact_download_url`][]
|
||||
Powershell,
|
||||
/// Generate an npm project that fetches from [`cargo_dist_schema::Release::artifact_download_url`][]
|
||||
/// Generate an npm project that fetches from [`dist_schema::Release::artifact_download_url`][]
|
||||
Npm,
|
||||
/// Generate a Homebrew formula that fetches from [`cargo_dist_schema::Release::artifact_download_url`][]
|
||||
/// Generate a Homebrew formula that fetches from [`dist_schema::Release::artifact_download_url`][]
|
||||
Homebrew,
|
||||
/// Generate an msi installer that embeds the binary
|
||||
Msi,
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! v0 config
|
||||
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
declare_strongly_typed_string, GithubRunner, GithubRunnerConfigInput, StringLikeOr,
|
||||
};
|
||||
use semver::Version;
|
||||
@ -78,7 +78,7 @@ pub struct DistMetadata {
|
||||
/// only plan out the release without running builds and "skip" will disable
|
||||
/// pull request runs entirely.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub pr_run_mode: Option<cargo_dist_schema::PrRunMode>,
|
||||
pub pr_run_mode: Option<dist_schema::PrRunMode>,
|
||||
|
||||
/// Generate targets whose dist should avoid checking for up-to-dateness.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! github ci config
|
||||
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
ContainerConfig, GithubRunner, GithubRunnerConfig, GithubRunnerConfigInput, StringLikeOr,
|
||||
TripleName,
|
||||
};
|
||||
|
@ -130,7 +130,7 @@ pub struct CommonCiLayer {
|
||||
/// only plan out the release without running builds and "skip" will disable
|
||||
/// pull request runs entirely.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub pr_run_mode: Option<cargo_dist_schema::PrRunMode>,
|
||||
pub pr_run_mode: Option<dist_schema::PrRunMode>,
|
||||
|
||||
/// a prefix to add to the release.yml and tag pattern so that
|
||||
/// dist can co-exist with other release workflows in complex workspaces
|
||||
@ -203,7 +203,7 @@ pub struct CommonCiConfig {
|
||||
pub release_branch: Option<String>,
|
||||
|
||||
/// Which actions to run on pull requests.
|
||||
pub pr_run_mode: cargo_dist_schema::PrRunMode,
|
||||
pub pr_run_mode: dist_schema::PrRunMode,
|
||||
|
||||
/// a prefix to add to the release.yml and tag pattern so that
|
||||
/// dist can co-exist with other release workflows in complex workspaces
|
||||
@ -237,7 +237,7 @@ impl CommonCiConfig {
|
||||
build_local_artifacts: true,
|
||||
dispatch_releases: false,
|
||||
release_branch: None,
|
||||
pr_run_mode: cargo_dist_schema::PrRunMode::default(),
|
||||
pr_run_mode: dist_schema::PrRunMode::default(),
|
||||
tag_namespace: None,
|
||||
plan_jobs: vec![],
|
||||
build_local_jobs: vec![],
|
||||
|
@ -9,9 +9,9 @@
|
||||
use axoproject::errors::AxoprojectError;
|
||||
use backtrace::Backtrace;
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::{target_lexicon::Triple, ArtifactId, TripleName};
|
||||
use color_backtrace::BacktracePrinter;
|
||||
use console::style;
|
||||
use dist_schema::{target_lexicon::Triple, ArtifactId, TripleName};
|
||||
use miette::{Diagnostic, SourceOffset, SourceSpan};
|
||||
use thiserror::Error;
|
||||
|
||||
@ -72,7 +72,7 @@ pub enum DistError {
|
||||
|
||||
/// random triple parse error
|
||||
#[error(transparent)]
|
||||
TripleError(#[from] cargo_dist_schema::target_lexicon::ParseError),
|
||||
TripleError(#[from] dist_schema::target_lexicon::ParseError),
|
||||
|
||||
/// A problem with a jinja template, which is always a dist bug
|
||||
#[error("Failed to render template")]
|
||||
|
@ -14,7 +14,7 @@ use crate::{
|
||||
DistError, DistGraph, DistGraphBuilder, HostingInfo,
|
||||
};
|
||||
use axoproject::WorkspaceGraph;
|
||||
use cargo_dist_schema::{ArtifactIdRef, DistManifest, Hosting};
|
||||
use dist_schema::{ArtifactIdRef, DistManifest, Hosting};
|
||||
use gazenot::{AnnouncementKey, Gazenot};
|
||||
|
||||
/// Do hosting
|
||||
@ -190,7 +190,7 @@ impl<'a> DistGraphBuilder<'a> {
|
||||
self.manifest
|
||||
.ensure_release(name.clone(), version.clone())
|
||||
.hosting
|
||||
.github = Some(cargo_dist_schema::GithubHosting {
|
||||
.github = Some(dist_schema::GithubHosting {
|
||||
artifact_base_url: hosting.domain.clone(),
|
||||
artifact_download_path: format!("{repo_path}/releases/download/{tag}"),
|
||||
owner: hosting.owner.clone(),
|
||||
|
@ -1,7 +1,7 @@
|
||||
use axoasset::{toml_edit, LocalAsset};
|
||||
use axoproject::{WorkspaceGraph, WorkspaceInfo, WorkspaceKind};
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::TripleNameRef;
|
||||
use dist_schema::TripleNameRef;
|
||||
use semver::Version;
|
||||
use serde::Deserialize;
|
||||
|
||||
|
@ -27,11 +27,11 @@ use build::{
|
||||
fake::{build_fake_cargo_target, build_fake_generic_target},
|
||||
};
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{ArtifactId, ChecksumValue, ChecksumValueRef, DistManifest, TripleName};
|
||||
use config::{
|
||||
ArtifactMode, ChecksumStyle, CompressionImpl, Config, DirtyMode, GenerateMode, ZipStyle,
|
||||
};
|
||||
use console::Term;
|
||||
use dist_schema::{ArtifactId, ChecksumValue, ChecksumValueRef, DistManifest, TripleName};
|
||||
use semver::Version;
|
||||
use temp_dir::TempDir;
|
||||
use tracing::info;
|
||||
|
@ -8,11 +8,11 @@ use std::{
|
||||
use axoasset::SourceFile;
|
||||
use axoprocess::Cmd;
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::{
|
||||
use comfy_table::{presets::UTF8_FULL, Table};
|
||||
use dist_schema::{
|
||||
AssetInfo, BuildEnvironment, DistManifest, GlibcVersion, Library, Linkage, PackageManager,
|
||||
TripleNameRef,
|
||||
};
|
||||
use comfy_table::{presets::UTF8_FULL, Table};
|
||||
use goblin::Object;
|
||||
use mach_object::{LoadCommand, OFile};
|
||||
use tracing::warn;
|
||||
|
@ -9,7 +9,6 @@ use axoprocess::Cmd;
|
||||
use axoupdater::AxoUpdater;
|
||||
use camino::Utf8PathBuf;
|
||||
// Import everything from the lib version of ourselves
|
||||
use cargo_dist_schema::{AssetKind, DistManifest};
|
||||
use clap::Parser;
|
||||
use cli::{
|
||||
Cli, Commands, GenerateMode, HelpMarkdownArgs, HostArgs, ManifestArgs, OutputFormat, PlanArgs,
|
||||
@ -17,6 +16,7 @@ use cli::{
|
||||
};
|
||||
use console::Term;
|
||||
use dist::{linkage::LinkageDisplay, *};
|
||||
use dist_schema::{AssetKind, DistManifest};
|
||||
use miette::{miette, IntoDiagnostic};
|
||||
use net::ClientSettings;
|
||||
|
||||
@ -116,7 +116,7 @@ fn print_human(out: &mut Term, manifest: &DistManifest) -> Result<(), std::io::E
|
||||
)?;
|
||||
for artifact_id in &release.artifacts {
|
||||
let artifact = &manifest.artifacts[artifact_id];
|
||||
if let cargo_dist_schema::ArtifactKind::Checksum = &artifact.kind {
|
||||
if let dist_schema::ArtifactKind::Checksum = &artifact.kind {
|
||||
// Don't print shasums at top-level
|
||||
continue;
|
||||
}
|
||||
@ -186,7 +186,7 @@ fn print_human(out: &mut Term, manifest: &DistManifest) -> Result<(), std::io::E
|
||||
|
||||
fn print_human_artifact_path(
|
||||
out: &mut Term,
|
||||
artifact: &cargo_dist_schema::Artifact,
|
||||
artifact: &dist_schema::Artifact,
|
||||
) -> Result<(), std::io::Error> {
|
||||
// Print out the name or path of the artifact (path is more useful by noisier)
|
||||
if let Some(path) = &artifact.path {
|
||||
@ -242,7 +242,7 @@ fn cmd_print_upload_files_from_manifest(
|
||||
args: &PrintUploadFilesFromManifestArgs,
|
||||
) -> Result<(), miette::Report> {
|
||||
let manifest_str = axoasset::LocalAsset::load_string(&args.manifest)?;
|
||||
let manifest = serde_json::from_str::<cargo_dist_schema::DistManifest>(&manifest_str)
|
||||
let manifest = serde_json::from_str::<dist_schema::DistManifest>(&manifest_str)
|
||||
.into_diagnostic()
|
||||
.map_err(|err| miette!("Failed to parse manifest as JSON: {}", err))?;
|
||||
|
||||
@ -404,7 +404,7 @@ fn generate_manifest(
|
||||
.as_ref()
|
||||
.and_then(|ci| ci.github.as_ref())
|
||||
.and_then(|gh| gh.pr_run_mode)
|
||||
== Some(cargo_dist_schema::PrRunMode::Upload))
|
||||
== Some(dist_schema::PrRunMode::Upload))
|
||||
{
|
||||
let message = concat!(
|
||||
" note: Forcing needs_coherence=true, because pr-run-mode=\"upload\" is set.\n",
|
||||
@ -661,7 +661,7 @@ fn cmd_manifest_schema(
|
||||
_config: &Cli,
|
||||
args: &cli::ManifestSchemaArgs,
|
||||
) -> Result<(), miette::ErrReport> {
|
||||
let schema = cargo_dist_schema::DistManifest::json_schema();
|
||||
let schema = dist_schema::DistManifest::json_schema();
|
||||
let json_schema = serde_json::to_string_pretty(&schema).expect("failed to stringify schema!?");
|
||||
|
||||
if let Some(destination) = args.output.to_owned() {
|
||||
|
@ -37,7 +37,7 @@
|
||||
use std::collections::btree_map::Entry;
|
||||
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
Artifact, ArtifactId, Asset, AssetKind, DistManifest, DynamicLibraryAsset, ExecutableAsset,
|
||||
Hosting, StaticLibraryAsset,
|
||||
};
|
||||
@ -336,12 +336,12 @@ fn add_manifest_artifact(
|
||||
ArtifactKind::ExecutableZip(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::ExecutableZip;
|
||||
kind = dist_schema::ArtifactKind::ExecutableZip;
|
||||
}
|
||||
ArtifactKind::Symbols(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::Symbols;
|
||||
kind = dist_schema::ArtifactKind::Symbols;
|
||||
}
|
||||
ArtifactKind::Installer(
|
||||
InstallerImpl::Powershell(info)
|
||||
@ -354,58 +354,58 @@ fn add_manifest_artifact(
|
||||
) => {
|
||||
install_hint = Some(info.hint.clone());
|
||||
description = Some(info.desc.clone());
|
||||
kind = cargo_dist_schema::ArtifactKind::Installer;
|
||||
kind = dist_schema::ArtifactKind::Installer;
|
||||
}
|
||||
ArtifactKind::Installer(InstallerImpl::Msi(..)) => {
|
||||
install_hint = None;
|
||||
description = Some("install via msi".to_owned());
|
||||
kind = cargo_dist_schema::ArtifactKind::Installer;
|
||||
kind = dist_schema::ArtifactKind::Installer;
|
||||
}
|
||||
ArtifactKind::Installer(InstallerImpl::Pkg(..)) => {
|
||||
install_hint = None;
|
||||
description = Some("install via pkg".to_owned());
|
||||
kind = cargo_dist_schema::ArtifactKind::Installer;
|
||||
kind = dist_schema::ArtifactKind::Installer;
|
||||
}
|
||||
ArtifactKind::Checksum(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::Checksum;
|
||||
kind = dist_schema::ArtifactKind::Checksum;
|
||||
}
|
||||
ArtifactKind::UnifiedChecksum(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::UnifiedChecksum;
|
||||
kind = dist_schema::ArtifactKind::UnifiedChecksum;
|
||||
}
|
||||
ArtifactKind::SourceTarball(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::SourceTarball;
|
||||
kind = dist_schema::ArtifactKind::SourceTarball;
|
||||
}
|
||||
ArtifactKind::ExtraArtifact(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::ExtraArtifact;
|
||||
kind = dist_schema::ArtifactKind::ExtraArtifact;
|
||||
}
|
||||
ArtifactKind::Updater(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::Updater;
|
||||
kind = dist_schema::ArtifactKind::Updater;
|
||||
}
|
||||
ArtifactKind::SBOM(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::SBOM;
|
||||
kind = dist_schema::ArtifactKind::SBOM;
|
||||
}
|
||||
ArtifactKind::OmniborArtifactId(_) => {
|
||||
install_hint = None;
|
||||
description = None;
|
||||
kind = cargo_dist_schema::ArtifactKind::OmniborArtifactId;
|
||||
kind = dist_schema::ArtifactKind::OmniborArtifactId;
|
||||
}
|
||||
};
|
||||
|
||||
let checksum = artifact.checksum.map(|idx| dist.artifact(idx).id.clone());
|
||||
|
||||
let out_artifact = cargo_dist_schema::Artifact {
|
||||
let out_artifact = dist_schema::Artifact {
|
||||
name: Some(artifact.id.clone()),
|
||||
path: if cfg.no_local_paths {
|
||||
None
|
||||
|
@ -232,7 +232,7 @@ pub mod targets;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::{
|
||||
ArtifactId, AssetId, BuildEnvironment, ChecksumExtension, ChecksumValue, DistManifest,
|
||||
GlibcVersion, Linkage, SystemInfo, TripleName, TripleNameRef,
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::platform::targets as t;
|
||||
use cargo_dist_schema::{target_lexicon::Triple, GithubRunnerRef, TripleNameRef};
|
||||
use dist_schema::{target_lexicon::Triple, GithubRunnerRef, TripleNameRef};
|
||||
use tracing::warn;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// Various target triples
|
||||
|
||||
use cargo_dist_schema::TripleNameRef;
|
||||
use dist_schema::TripleNameRef;
|
||||
|
||||
macro_rules! define_target_triples {
|
||||
($($(#[$meta:meta])* const $name:ident = $triple:expr;)*) => {
|
||||
|
@ -22,7 +22,7 @@ use axoasset::LocalAsset;
|
||||
use axoprocess::Cmd;
|
||||
use base64::Engine;
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::TripleNameRef;
|
||||
use dist_schema::TripleNameRef;
|
||||
use temp_dir::TempDir;
|
||||
use tracing::warn;
|
||||
|
||||
|
@ -5,7 +5,7 @@ use std::os::unix::fs::PermissionsExt;
|
||||
|
||||
use axoasset::AxoClient;
|
||||
use camino::Utf8Path;
|
||||
use cargo_dist_schema::TripleNameRef;
|
||||
use dist_schema::TripleNameRef;
|
||||
|
||||
use crate::{config::ProductionMode, DistResult};
|
||||
|
||||
|
@ -4,7 +4,7 @@ use axoasset::LocalAsset;
|
||||
use axoprocess::Cmd;
|
||||
use camino::Utf8Path;
|
||||
use camino::Utf8PathBuf;
|
||||
use cargo_dist_schema::TripleNameRef;
|
||||
use dist_schema::TripleNameRef;
|
||||
use tracing::info;
|
||||
use tracing::warn;
|
||||
|
||||
|
@ -58,8 +58,8 @@ use axoasset::AxoClient;
|
||||
use axoprocess::Cmd;
|
||||
use axoproject::{PackageId, PackageIdx, WorkspaceGraph};
|
||||
use camino::{Utf8Path, Utf8PathBuf};
|
||||
use cargo_dist_schema::target_lexicon::{OperatingSystem, Triple};
|
||||
use cargo_dist_schema::{
|
||||
use dist_schema::target_lexicon::{OperatingSystem, Triple};
|
||||
use dist_schema::{
|
||||
ArtifactId, BuildEnvironment, DistManifest, HomebrewPackageName, SystemId, SystemInfo,
|
||||
TripleName, TripleNameRef,
|
||||
};
|
||||
@ -2980,14 +2980,14 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> {
|
||||
.github_release
|
||||
.as_ref()
|
||||
.and_then(|r| r.external_repo_commit.clone());
|
||||
cargo_dist_schema::GithubCiInfo {
|
||||
dist_schema::GithubCiInfo {
|
||||
artifacts_matrix: Some(info.artifacts_matrix.clone()),
|
||||
pr_run_mode: Some(info.pr_run_mode),
|
||||
external_repo_commit,
|
||||
}
|
||||
});
|
||||
|
||||
self.manifest.ci = Some(cargo_dist_schema::CiInfo { github });
|
||||
self.manifest.ci = Some(dist_schema::CiInfo { github });
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -123,7 +123,7 @@ fn test_lib_manifest() {
|
||||
.arg("--output-format=json")
|
||||
.arg("--verbose=error")
|
||||
.arg("--tag")
|
||||
.arg(&format!("cargo-dist-schema-v{}", version))
|
||||
.arg(&format!("dist-schema-v{}", version))
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.output()
|
||||
@ -149,7 +149,7 @@ fn test_lib_manifest_slash() {
|
||||
.arg("--output-format=json")
|
||||
.arg("--verbose=error")
|
||||
.arg("--tag")
|
||||
.arg(&format!("cargo-dist-schema/v{}", version))
|
||||
.arg(&format!("dist-schema/v{}", version))
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.output()
|
||||
|
@ -512,7 +512,7 @@ impl PlanResult {
|
||||
self.snapshot()
|
||||
}
|
||||
|
||||
pub fn parse(&self) -> Result<cargo_dist_schema::DistManifest> {
|
||||
pub fn parse(&self) -> Result<dist_schema::DistManifest> {
|
||||
let src = SourceFile::new("dist-manifest.json", self.raw_json.clone());
|
||||
let val = src.deserialize_json()?;
|
||||
Ok(val)
|
||||
|
23
cargo-dist/tests/snapshots/lib_manifest.snap
generated
23
cargo-dist/tests/snapshots/lib_manifest.snap
generated
@ -1,6 +1,7 @@
|
||||
---
|
||||
source: cargo-dist/tests/cli-tests.rs
|
||||
expression: format_outputs(&output)
|
||||
snapshot_kind: text
|
||||
---
|
||||
stdout:
|
||||
{
|
||||
@ -13,29 +14,29 @@ stdout:
|
||||
"announcement_github_body": "CENSORED"
|
||||
"releases": [
|
||||
{
|
||||
"app_name": "cargo-dist-schema",
|
||||
"app_name": "dist-schema",
|
||||
"app_version": "1.0.0-FAKEVERSION",
|
||||
"env": {
|
||||
"install_dir_env_var": "CARGO_DIST_SCHEMA_INSTALL_DIR",
|
||||
"unmanaged_dir_env_var": "CARGO_DIST_SCHEMA_UNMANAGED_INSTALL",
|
||||
"disable_update_env_var": "CARGO_DIST_SCHEMA_DISABLE_UPDATE",
|
||||
"no_modify_path_env_var": "CARGO_DIST_SCHEMA_NO_MODIFY_PATH",
|
||||
"github_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL",
|
||||
"ghe_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GHE_BASE_URL"
|
||||
"install_dir_env_var": "DIST_SCHEMA_INSTALL_DIR",
|
||||
"unmanaged_dir_env_var": "DIST_SCHEMA_UNMANAGED_INSTALL",
|
||||
"disable_update_env_var": "DIST_SCHEMA_DISABLE_UPDATE",
|
||||
"no_modify_path_env_var": "DIST_SCHEMA_NO_MODIFY_PATH",
|
||||
"github_base_url_env_var": "DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL",
|
||||
"ghe_base_url_env_var": "DIST_SCHEMA_INSTALLER_GHE_BASE_URL"
|
||||
},
|
||||
"display_name": "cargo-dist-schema",
|
||||
"display_name": "dist-schema",
|
||||
"display": true,
|
||||
"hosting": {
|
||||
"github": {
|
||||
"artifact_base_url": "https://github.com",
|
||||
"artifact_download_path": "/axodotdev/cargo-dist/releases/download/cargo-dist-schema-v1.0.0-FAKEVERSION",
|
||||
"artifact_download_path": "/axodotdev/cargo-dist/releases/download/dist-schema-v1.0.0-FAKEVERSION",
|
||||
"owner": "axodotdev",
|
||||
"repo": "cargo-dist"
|
||||
},
|
||||
"axodotdev": {
|
||||
"package": "cargo-dist-schema",
|
||||
"package": "dist-schema",
|
||||
"public_id": "fake-id-do-not-upload",
|
||||
"set_download_url": "https://fake.axo.dev/faker/cargo-dist-schema/fake-id-do-not-upload",
|
||||
"set_download_url": "https://fake.axo.dev/faker/dist-schema/fake-id-do-not-upload",
|
||||
"upload_url": null,
|
||||
"release_url": null,
|
||||
"announce_url": null
|
||||
|
23
cargo-dist/tests/snapshots/lib_manifest_slash.snap
generated
23
cargo-dist/tests/snapshots/lib_manifest_slash.snap
generated
@ -1,6 +1,7 @@
|
||||
---
|
||||
source: cargo-dist/tests/cli-tests.rs
|
||||
expression: format_outputs(&output)
|
||||
snapshot_kind: text
|
||||
---
|
||||
stdout:
|
||||
{
|
||||
@ -13,29 +14,29 @@ stdout:
|
||||
"announcement_github_body": "CENSORED"
|
||||
"releases": [
|
||||
{
|
||||
"app_name": "cargo-dist-schema",
|
||||
"app_name": "dist-schema",
|
||||
"app_version": "1.0.0-FAKEVERSION",
|
||||
"env": {
|
||||
"install_dir_env_var": "CARGO_DIST_SCHEMA_INSTALL_DIR",
|
||||
"unmanaged_dir_env_var": "CARGO_DIST_SCHEMA_UNMANAGED_INSTALL",
|
||||
"disable_update_env_var": "CARGO_DIST_SCHEMA_DISABLE_UPDATE",
|
||||
"no_modify_path_env_var": "CARGO_DIST_SCHEMA_NO_MODIFY_PATH",
|
||||
"github_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL",
|
||||
"ghe_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GHE_BASE_URL"
|
||||
"install_dir_env_var": "DIST_SCHEMA_INSTALL_DIR",
|
||||
"unmanaged_dir_env_var": "DIST_SCHEMA_UNMANAGED_INSTALL",
|
||||
"disable_update_env_var": "DIST_SCHEMA_DISABLE_UPDATE",
|
||||
"no_modify_path_env_var": "DIST_SCHEMA_NO_MODIFY_PATH",
|
||||
"github_base_url_env_var": "DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL",
|
||||
"ghe_base_url_env_var": "DIST_SCHEMA_INSTALLER_GHE_BASE_URL"
|
||||
},
|
||||
"display_name": "cargo-dist-schema",
|
||||
"display_name": "dist-schema",
|
||||
"display": true,
|
||||
"hosting": {
|
||||
"github": {
|
||||
"artifact_base_url": "https://github.com",
|
||||
"artifact_download_path": "/axodotdev/cargo-dist/releases/download/cargo-dist-schema/v1.0.0-FAKEVERSION",
|
||||
"artifact_download_path": "/axodotdev/cargo-dist/releases/download/dist-schema/v1.0.0-FAKEVERSION",
|
||||
"owner": "axodotdev",
|
||||
"repo": "cargo-dist"
|
||||
},
|
||||
"axodotdev": {
|
||||
"package": "cargo-dist-schema",
|
||||
"package": "dist-schema",
|
||||
"public_id": "fake-id-do-not-upload",
|
||||
"set_download_url": "https://fake.axo.dev/faker/cargo-dist-schema/fake-id-do-not-upload",
|
||||
"set_download_url": "https://fake.axo.dev/faker/dist-schema/fake-id-do-not-upload",
|
||||
"upload_url": null,
|
||||
"release_url": null,
|
||||
"announce_url": null
|
||||
|
Loading…
x
Reference in New Issue
Block a user