Skip to content

Commit

Permalink
fix publication in crates.io with tag v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
StackOverflowExcept1on committed Apr 23, 2024
1 parent d9cfd99 commit 6a58bfb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/crates-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,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 -p crates-io check
run: cargo +stable run -p crates-io check

- name: "Publish packages"
if: ${{ inputs.publish }}
run: cargo run -p crates-io publish -v ${{ inputs.version }}
run: cargo +stable run -p crates-io publish -v ${{ inputs.version }}
12 changes: 9 additions & 3 deletions utils/crates-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,29 @@ pub const PACKAGE_ALIAS: [(&str, &str); 2] = [
/// Check the input package
pub fn check(manifest: &str) -> Result<ExitStatus> {
Command::new("cargo")
.args(["check", "--lib", "--manifest-path", manifest])
.args(["+stable", "check", "--lib", "--manifest-path", manifest])
.status()
.map_err(Into::into)
}

/// Test the input package
pub fn test(package: &str, test: &str) -> Result<ExitStatus> {
Command::new("cargo")
.args(["test", "-p", package, "--", test])
.args(["+stable", "test", "-p", package, "--", test])
.status()
.map_err(Into::into)
}

/// Publish the input package
pub fn publish(manifest: &str) -> Result<ExitStatus> {
Command::new("cargo")
.args(["publish", "--manifest-path", manifest, "--allow-dirty"])
.args([
"+stable",
"publish",
"--manifest-path",
manifest,
"--allow-dirty",
])
.status()
.map_err(Into::into)
}
4 changes: 3 additions & 1 deletion utils/crates-io/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 6a58bfb

Please sign in to comment.