Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(crates-io): introduce crates-io manager #3103

Merged
merged 61 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ed14be8
feat(crates-io): serialize packages to be published with version and …
clearloop Aug 18, 2023
4efa995
feat(crates-io): publish packages in order
clearloop Aug 18, 2023
9c9f161
feat(crates-io): serde manifest with cargo_toml
clearloop Aug 19, 2023
f755f4c
chore(codegen): force default features for syn
clearloop Aug 19, 2023
eb40006
chore(crates-io): update version of detailed dep
clearloop Aug 19, 2023
4e469f0
feat(crates-io): verify package before publishing
clearloop Aug 19, 2023
a2f9ea5
feat(crates-io): patch core-processor, subxt and sp-arithmetic in cra…
clearloop Aug 19, 2023
c9c25a2
feat(crates-io): merge functions
clearloop Aug 19, 2023
4f30285
ci(crates-io): introduce CI for publishing packages
clearloop Aug 19, 2023
52d249a
feat(crates-io): show case in CI
clearloop Aug 19, 2023
1982768
ci(clippy): make clippy happy
clearloop Aug 19, 2023
9a3f4af
chore(crates-io): clean workspace
clearloop Aug 19, 2023
42cc3ee
Merge branch 'master' into cl/issue-2832
clearloop Aug 19, 2023
7601972
chore(lock): update Cargo.lock
clearloop Aug 19, 2023
3fbdccf
Merge branch 'master' into cl/issue-2832
clearloop Aug 20, 2023
20c3875
Merge branch 'master' into cl/issue-2832
clearloop Aug 31, 2023
508cf63
Merge branch 'master' into cl/issue-2832
clearloop Sep 4, 2023
1d7a34f
chore(crates-io): queue sandbox deps to manager
clearloop Sep 4, 2023
8a417d6
chore(wasm-instrument): clean dep features
clearloop Sep 5, 2023
80dced3
chore(utils): add actor-system-error
clearloop Sep 5, 2023
c65856b
chore(utils): metadata for actor-system-error
clearloop Sep 5, 2023
d7066e2
chore(host): specify wasmi version
clearloop Sep 5, 2023
7cdba5e
chore(sandbox-host): pin version to workspace
clearloop Sep 5, 2023
c673227
chore(gcli): disable command meta
clearloop Sep 6, 2023
b79ea94
chore(crates-io): disable gear-sandbox-host
clearloop Sep 6, 2023
76987a3
chore(clippy): make clippy happy
clearloop Sep 6, 2023
002f9f5
ci(crates-io): test publishing
clearloop Sep 6, 2023
0fc801f
chore(lock): update Cargo.lock
clearloop Sep 6, 2023
68bbd6d
ci(crates-io): trigger only on dispatch
clearloop Sep 6, 2023
c9a6782
chore(gcli): ignore metadata tests
clearloop Sep 7, 2023
d2470d4
chore(clippy): make clippy happy
clearloop Sep 7, 2023
3bc7b81
Merge branch 'master' into cl/issue-2832
clearloop Sep 11, 2023
21df62f
ci(clippy): happy clippy
clearloop Sep 11, 2023
e8672cc
ci(crates-io): show case
clearloop Sep 11, 2023
f04a52e
ci(crates-io): trigger only on dispatching
clearloop Sep 11, 2023
e667982
ci(clippy): happy clippy
clearloop Sep 11, 2023
8200d91
Merge branch 'master' into cl/issue-2832
clearloop Sep 17, 2023
63dba93
chore(lock): update Cargo.lock
clearloop Sep 17, 2023
cf14ca2
Merge branch 'master' into cl/issue-2832
clearloop Oct 28, 2023
cfdd4c9
feat(crates-io): remove more pkgs
clearloop Oct 30, 2023
f530af9
chore(wasm-instrument): rename syscall table tests to core-backend
clearloop Oct 30, 2023
1e1d652
Merge branch 'cl/rename-sys-call-tests' into cl/issue-2832
clearloop Oct 30, 2023
24b31ee
chore(crates-io): remove patches for core-processor
clearloop Oct 30, 2023
294991d
chore(gcli): address comments
clearloop Oct 30, 2023
cb54eed
Merge branch 'master' into cl/issue-2832
clearloop Oct 30, 2023
f5b6a6f
chore(crates-io): test with pre.11
clearloop Oct 31, 2023
47e67dc
ci(crates-io): test with ci
clearloop Oct 31, 2023
7865e45
chore(gcli): remove lazy page
clearloop Nov 1, 2023
0e9e6d2
ci(crates-io): back to on workflow dispatch
clearloop Nov 1, 2023
3b9f297
ci(build): trigger
clearloop Nov 2, 2023
a2e76e6
Merge branch 'master' into cl/issue-2832
clearloop Nov 7, 2023
7a07875
Merge branch 'master' into cl/issue-2832
clearloop Nov 11, 2023
254a1de
ci(crates-io): test release still works
clearloop Nov 11, 2023
ec8907e
ci(crates-io): only work on dispatch
clearloop Nov 11, 2023
a83b466
ci(clippy): make clippy happy
clearloop Nov 11, 2023
6f55d0c
Merge branch 'master' into cl/issue-2832
clearloop Nov 15, 2023
271a9e2
chore(sandbox-host): inherit deps from workspace
clearloop Nov 15, 2023
5155633
ci(crates-io): preview publishing still works
clearloop Nov 15, 2023
d9d776b
ci(crates-io): retrive version
clearloop Nov 15, 2023
9c05fa3
Merge branch 'master' into cl/issue-2832
clearloop Nov 17, 2023
fb25c97
ci(build): trigger build
clearloop Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(crates-io): merge functions
  • Loading branch information
clearloop committed Aug 19, 2023
commit c9c25a2491cfabb529bee6ad38207703666d9b91
1 change: 0 additions & 1 deletion gclient/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ futures-timer.workspace = true
async-trait.workspace = true
url.workspace = true
wabt.workspace = true
gstd.workspace = true
static_assertions.workspace = true

[dev-dependencies]
Expand Down
56 changes: 30 additions & 26 deletions utils/crates-io/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const PACKAGES: [&str; 17] = [
"gclient",
];

/// Packages need to be patched in depdenencies.
const PATCHED_PACKAGES: [&str; 3] = ["core-processor", "sp-arithmetic", "subxt"];

struct CratesIo {
registry: Registry,
}
Expand Down Expand Up @@ -111,48 +114,49 @@ fn main() -> Result<()> {
manifest.lib = Some(product);
}
} else if p.name == "gear-core-processor" {
// Change the name of gear-core-processor to gear-processor since
// gear-core-processor has been taken by others.
if let Some(mut metadata) = manifest.package {
metadata.name = "gear-processor".into();
manifest.package = Some(metadata);
}
}

for (name, dep) in manifest.dependencies.iter_mut() {
// NOTE: the required version of sp-arithmetic is 6.0.0 in
// git repo, but 7.0.0 in crates.io, so we need to fix it.
if name == "sp-arithmetic" {
if let Dependency::Detailed(detail) = &dep {
let mut detail = detail.clone();
detail.version = Some("7.0.0".into());
detail.branch = None;
detail.git = None;

*dep = Dependency::Detailed(detail.clone());
}
} else if name == "subxt" {
if let Dependency::Detailed(detail) = &dep {
let mut detail = detail.clone();
detail.package = Some("gear-subxt".into());
*dep = Dependency::Detailed(detail.clone());
}
}

// No need to update dependencies for packages without
// local dependencies.
if !index.contains_key(name) && name != "core-processor" {
if !index.contains_key(name) && !PATCHED_PACKAGES.contains(&name.as_str()) {
continue;
}

if let Dependency::Detailed(detail) = &dep {
let mut detail = detail.clone();
detail.version = Some(version.to_string());
let mut detail = if let Dependency::Detailed(detail) = &dep {
detail.clone()
} else {
continue;
};

if detail.package == Some("gear-core-processor".into()) {
detail.package = Some("gear-processor".into());
match name {
// NOTE: the required version of sp-arithmetic is 6.0.0 in
// git repo, but 7.0.0 in crates.io, so we need to fix it.
"sp-arithmetic" => {
detail.version = Some("7.0.0".into());
detail.branch = None;
detail.git = None;
}
"subxt" => {
detail.package = Some("gear-subxt".into());
}
_ => {
detail.version = Some(version.to_string());

*dep = Dependency::Detailed(detail.clone());
// Patch for gear-core-processor in dependencies.
if detail.package == Some("gear-core-processor".into()) {
detail.package = Some("gear-processor".into());
}
}
}

*dep = Dependency::Detailed(detail);
}

graph.insert(index.get(&p.name), (path, manifest));
Expand Down