From 232567c90d20ec279aa9d9e7db7453d330fd38ad Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 23 Apr 2024 18:08:57 +0300 Subject: [PATCH] fix publication in crates.io with tag v1.2.x --- .github/workflows/crates-io.yml | 13 ++++++++----- utils/crates-io/src/lib.rs | 12 +++++++++--- utils/crates-io/src/manifest.rs | 4 +++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/crates-io.yml b/.github/workflows/crates-io.yml index b668ff89674..0801690cc16 100644 --- a/.github/workflows/crates-io.yml +++ b/.github/workflows/crates-io.yml @@ -20,20 +20,23 @@ env: jobs: check: - runs-on: ubuntu-latest + runs-on: [kuberunner] env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} steps: - name: "ACTIONS: Checkout" uses: actions/checkout@v4 - - name: "Install: Rust toolchain" - uses: dsherret/rust-toolchain-file@v1 + - name: "Install: Rust stable toolchain" + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + components: llvm-tools - name: "Check packages" if: ${{ !inputs.publish }} - run: cargo run --release -p crates-io check + run: cargo +stable run --release -p crates-io check - name: "Publish packages" if: ${{ inputs.publish }} - run: cargo run --release -p crates-io publish -v ${{ inputs.version }} + run: cargo +stable run --release -p crates-io publish -v ${{ inputs.version }} diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index fbfb9335b3d..96301a54001 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -85,7 +85,7 @@ pub const PACKAGE_ALIAS: [(&str, &str); 2] = [ /// Check the input package pub fn check(manifest: &str) -> Result { Command::new("cargo") - .args(["check", "--lib", "--manifest-path", manifest]) + .args(["+stable", "check", "--lib", "--manifest-path", manifest]) .status() .map_err(Into::into) } @@ -93,7 +93,7 @@ pub fn check(manifest: &str) -> Result { /// Test the input package pub fn test(package: &str, test: &str) -> Result { Command::new("cargo") - .args(["test", "-p", package, "--", test]) + .args(["+stable", "test", "-p", package, "--", test]) .status() .map_err(Into::into) } @@ -101,7 +101,13 @@ pub fn test(package: &str, test: &str) -> Result { /// Publish the input package pub fn publish(manifest: &str) -> Result { Command::new("cargo") - .args(["publish", "--manifest-path", manifest, "--allow-dirty"]) + .args([ + "+stable", + "publish", + "--manifest-path", + manifest, + "--allow-dirty", + ]) .status() .map_err(Into::into) } diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 8aeafe65edd..0b4031ee7bc 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -26,7 +26,7 @@ use std::{ ops::{Deref, DerefMut}, path::PathBuf, }; -use toml_edit::Document; +use toml_edit::{Document, Item}; const WORKSPACE_NAME: &str = "__gear_workspace"; @@ -63,6 +63,8 @@ impl Workspace { workspace.manifest["workspace"]["package"]["version"] = toml_edit::value(version); } + workspace.manifest["workspace"]["dependencies"]["gstd"]["features"] = Item::None; + Ok(workspace) }