Skip to content

Commit

Permalink
feat(crates-io): simulate packages publishing (#4147)
Browse files Browse the repository at this point in the history
  • Loading branch information
StackOverflowExcept1on authored Aug 17, 2024
1 parent b4e1d6c commit b710fb8
Show file tree
Hide file tree
Showing 13 changed files with 520 additions and 114 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
cargo +stable check --manifest-path utils/wasm-builder/test-program/Cargo.toml
cargo +stable check --manifest-path utils/cargo-gbuild/test-program/Cargo.toml --workspace --target wasm32-unknown-unknown
- name: "Check: crates-io packages"
run: cargo +stable run --release -p crates-io check
- name: "Check: crates-io packages publishing"
run: cargo +stable run --release -p crates-io publish --simulate --registry-path /tmp/cargo-http-registry

fuzzer:
runs-on: [kuberunner, github-runner-01]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/crates-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
targets: wasm32-unknown-unknown
components: llvm-tools

- name: "Check packages"
- name: "Publish packages (simulate)"
if: ${{ !inputs.publish }}
run: cargo +stable run -p crates-io check
run: cargo +stable run --release -p crates-io publish -v ${{ inputs.version }} --simulate --registry-path /tmp/cargo-http-registry

- name: "Publish packages"
if: ${{ inputs.publish }}
run: cargo +stable run -p crates-io publish -v ${{ inputs.version }}
run: cargo +stable run --release -p crates-io publish -v ${{ inputs.version }}
204 changes: 202 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ demo-wat = { path = "examples/wat" }
# TODO: remove these dependencies (from this file?) or add more docs.

cfg-if = "1.0.0" # gear-lazy-pages
cargo-http-registry = "0.1.6" # crates-io
errno = "0.3" # gear-lazy-pages
nix = "0.26.4" # gear-lazy-pages
indexmap = "2.2.6" # utils/weight-diff
Expand Down
3 changes: 1 addition & 2 deletions gcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ gsys.workspace = true
gprimitives.workspace = true
gear-core-errors.workspace = true
gear-stack-buffer.workspace = true
codec = { workspace = true, optional = true }

[dev-dependencies]
hex-literal.workspace = true
galloc.workspace = true

[features]
codec = ["dep:codec", "gear-core-errors/codec", "gprimitives/codec"]
codec = ["gear-core-errors/codec", "gprimitives/codec"]
debug = []
ethexe = ["gsys/ethexe"]
3 changes: 3 additions & 0 deletions utils/crates-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ edition.workspace = true

[dependencies]
anyhow.workspace = true
cargo-http-registry.workspace = true
cargo_metadata.workspace = true
clap = { workspace = true, features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
reqwest = { workspace = true, features = ["blocking", "json", "default-tls"] }
tempfile.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
toml_edit.workspace = true
2 changes: 1 addition & 1 deletion utils/crates-io/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn crates_io_name(pkg: &str) -> &str {
/// Patch specified manifest by provided name.
pub fn patch(pkg: &Package) -> Result<Manifest> {
let mut manifest = Manifest::new(pkg)?;
let doc = &mut manifest.manifest;
let doc = &mut manifest.mutable_manifest;

match manifest.name.as_str() {
"gear-core-processor" => core_processor::patch(doc),
Expand Down
Loading

0 comments on commit b710fb8

Please sign in to comment.