diff --git a/.github/workflows/python-publish-node.yml b/.github/workflows/python-publish-node.yml index e7359edf8f..a03287eecc 100644 --- a/.github/workflows/python-publish-node.yml +++ b/.github/workflows/python-publish-node.yml @@ -150,32 +150,43 @@ jobs: - uses: actions/checkout@v4 - name: Prepare standalone package run: | - # Create a completely isolated build environment - ISOLATED_DIR="/tmp/ant-node-build" - mkdir -p "$ISOLATED_DIR/ant-node" - mkdir -p "$ISOLATED_DIR/deps" + # Create build directory structure + mkdir -p build/ant-node + cp -r ant-node/* build/ant-node/ - # Copy the main package - cp -r ant-node/* "$ISOLATED_DIR/ant-node/" - - # Copy dependencies + # First, copy all workspace members for dir in ant-* test-utils evmlib autonomi; do - if [ -d "$dir" ] && [ "$dir" != "ant-node" ]; then - echo "Copying $dir to deps directory" - cp -r "$dir" "$ISOLATED_DIR/deps/$dir" + if [ -d "$dir" ]; then + echo "Copying $dir to build directory" + cp -r "$dir" "build/$dir" fi done - # Update the package's Cargo.toml to be standalone - cd "$ISOLATED_DIR/ant-node" - - # Remove workspace references and add empty workspace table - sed -i '/^workspace/d' Cargo.toml - echo -e "\n[workspace]\n" >> Cargo.toml - - # Add lints directly to the package - cat >> Cargo.toml << EOL - [lints.rust] + # Create a new workspace Cargo.toml in the build directory + cat > build/Cargo.toml << EOL + [workspace] + resolver = "2" + members = [ + "ant-bootstrap", + "ant-build-info", + "ant-cli", + "ant-evm", + "ant-logging", + "ant-metrics", + "ant-networking", + "ant-node", + "ant-node-manager", + "ant-node-rpc-client", + "ant-protocol", + "ant-registers", + "ant-service-management", + "ant-token-supplies", + "autonomi", + "evmlib", + "test-utils" + ] + + [workspace.lints.rust] arithmetic_overflow = "forbid" mutable_transmutes = "forbid" no_mangle_const_items = "forbid" @@ -186,34 +197,46 @@ jobs: unused_extern_crates = "warn" unused_import_braces = "warn" - [lints.clippy] + [workspace.lints.clippy] clone_on_ref_ptr = "warn" unicode_not_nfc = "warn" uninlined_format_args = "warn" unused_async = "warn" unwrap_used = "warn" + + [profile.dev] + debug = 0 + strip = "debuginfo" + + [workspace.metadata.release] + pre-release-commit-message = "chore(release): release commit, tags, deps and changelog updates" + publish = false + push = false + tag = false + + [workspace.dependencies] + backtrace = "=0.3.71" EOL - # Update dependency paths to point to deps directory - sed -i 's|path = "\.\./|path = "../deps/|g' Cargo.toml - - # Display final Cargo.toml for debugging - echo "Contents of ant-node Cargo.toml:" - cat Cargo.toml + # Update all dependency paths to be absolute + find build -name "Cargo.toml" -exec sed -i "s|path = \"\.\./|path = \"/home/runner/work/autonomi/autonomi/build/|g" {} \; - # Create dist directory - mkdir -p dist + # Display directory structure for debugging + echo "Contents of build directory:" + ls -la build/ + echo "Contents of workspace Cargo.toml:" + cat build/Cargo.toml - name: Build sdist uses: PyO3/maturin-action@v1 with: command: sdist args: --out dist - working-directory: /tmp/ant-node-build/ant-node + working-directory: build/ant-node - name: Upload sdist uses: actions/upload-artifact@v4 with: name: wheels - path: /tmp/ant-node-build/ant-node/dist/*.tar.gz + path: build/ant-node/dist/*.tar.gz if-no-files-found: error release: