Skip to content

Commit

Permalink
fix: test11
Browse files Browse the repository at this point in the history
  • Loading branch information
dirvine committed Dec 24, 2024
1 parent ea14261 commit 697805f
Showing 1 changed file with 55 additions and 32 deletions.
87 changes: 55 additions & 32 deletions .github/workflows/python-publish-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down

0 comments on commit 697805f

Please sign in to comment.