Browse Source

Post dora 0.3.10 release fix (#804)

Very minor item fix after the release that poped up during the release
process.
tags/test-git
Haixuan Xavier Tao GitHub 1 year ago
parent
commit
fd90f411e4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 64 deletions
  1. +3
    -57
      .github/workflows/node-hub-ci-cd.yml
  2. +31
    -4
      .github/workflows/node_hub_test.sh
  3. +2
    -2
      Cargo.toml
  4. +3
    -1
      libraries/extensions/ros2-bridge/Cargo.toml
  5. +1
    -0
      libraries/extensions/ros2-bridge/msg-gen/Cargo.toml

+ 3
- 57
.github/workflows/node-hub-ci-cd.yml View File

@@ -78,65 +78,11 @@ jobs:
- name: Run Linting and Tests
## Run Linting and testing only on Mac for release workflows.
if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/'))
run: |
chmod +x ../../.github/workflows/node_hub_test.sh
../../.github/workflows/node_hub_test.sh

- name: Publish Projects
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/'))
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASS }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASS }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
dir=$(pwd)
base_dir=$(basename "$dir")
ignored_folders=("dora-parler")

if [[ " ${ignored_folders[@]} " =~ " ${base_dir} " ]]; then
echo "Skipping $base_dir as there is a hf model fetching issue..."
else
if [[ -f "Cargo.toml" && -f "pyproject.toml" ]]; then
echo "Publishing $dir using maturin..."
if [[ "${{ runner.os }}" == "Linux" ]]; then
pip install "maturin[zig]"
## The CI/CD is sequential to limit the number of workers used.
# x86_64-unknown-linux-gnu
maturin publish --skip-existing --zig
# aarch64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
maturin publish --target aarch64-unknown-linux-gnu --zig --skip-existing
# armv7-unknown-linux-musleabihf
rustup target add armv7-unknown-linux-musleabihf
maturin publish --target armv7-unknown-linux-musleabihf --zig --skip-existing

else
pip install maturin
maturin publish --skip-existing
fi
else
if [[ "${{ runner.os }}" == "Linux" ]]; then
if [ -f "pyproject.toml" ]; then
echo "Publishing $dir using UV..."
uv build
uv publish --check-url https://pypi.org/simple
fi

if [ -f "Cargo.toml" ]; then
echo "Publishing $dir using Cargo..."
package_name=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].name')
version=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version')
if cargo search "$package_name" | grep -q "^$package_name = \"$version\""; then
echo "Package '$package_name' version '$version' already exists on crates.io. Skipping publish."
else
echo "Publishing package '$package_name' version '$version'..."
cargo publish
fi
fi
fi
fi
fi
chmod +x ../../.github/workflows/node_hub_test.sh
../../.github/workflows/node_hub_test.sh

+ 31
- 4
.github/workflows/node_hub_test.sh View File

@@ -2,7 +2,10 @@
set -euo

# List of ignored modules
ignored_folders=("dora-internvl" "dora-parler" "dora-keyboard" "dora-microphone" "terminal-input")
ignored_folders=("dora-parler")

# Skip test
skip_test_folders=("dora-internvl" "dora-parler" "dora-keyboard" "dora-microphone" "terminal-input")

# Get current working directory
dir=$(pwd)
@@ -23,15 +26,27 @@ else
cargo test

pip install "maturin[zig]"
maturin build --zig
maturin build --zig --release
# If GITHUB_EVENT_NAME is release or workflow_dispatch, publish the wheel
if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then
maturin publish --skip-existing --zig
fi

# aarch64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
maturin build --target aarch64-unknown-linux-gnu --zig
# If GITHUB_EVENT_NAME is release or workflow_dispatch, publish the wheel
if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then
maturin publish --target aarch64-unknown-linux-gnu --skip-existing --zig
fi
# armv7-unknown-linux-musleabihf
rustup target add armv7-unknown-linux-musleabihf
maturin build --target armv7-unknown-linux-musleabihf --zig
# If GITHUB_EVENT_NAME is release or workflow_dispatch, publish the wheel
if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then
maturin publish --target armv7-unknown-linux-musleabihf --skip-existing --zig
fi
else
if [ -f "$dir/Cargo.toml" ]; then
echo "Running build and tests for Rust project in $dir..."
@@ -39,6 +54,10 @@ else
cargo clippy
cargo build
cargo test

if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then
cargo publish
fi
else
if [ -f "$dir/pyproject.toml" ]; then
echo "CI: Installing in $dir..."
@@ -47,7 +66,15 @@ else
echo "CI: Running Linting in $dir..."
uv run ruff check .
echo "CI: Running Pytest in $dir..."
uv run pytest
# Skip test for some folders
if [[ " ${skip_test_folders[@]} " =~ " ${base_dir} " ]]; then
echo "Skipping tests for $base_dir..."
else
uv run pytest
fi
if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then
uv publish --check-url https://pypi.org/simple
fi
fi
fi
fi

+ 2
- 2
Cargo.toml View File

@@ -70,8 +70,8 @@ communication-layer-request-reply = { version = "0.3.10", path = "libraries/comm
dora-runtime = { version = "0.3.10", path = "binaries/runtime" }
dora-daemon = { version = "0.3.10", path = "binaries/daemon" }
dora-coordinator = { version = "0.3.10", path = "binaries/coordinator" }
dora-ros2-bridge = { path = "libraries/extensions/ros2-bridge" }
dora-ros2-bridge-msg-gen = { path = "libraries/extensions/ros2-bridge/msg-gen" }
dora-ros2-bridge = { version = "0.3.10", path = "libraries/extensions/ros2-bridge" }
dora-ros2-bridge-msg-gen = { version = "0.3.10", path = "libraries/extensions/ros2-bridge/msg-gen" }
dora-ros2-bridge-python = { path = "libraries/extensions/ros2-bridge/python" }
# versioned independently from the other dora crates
dora-message = { version = "0.4.4", path = "libraries/message" }


+ 3
- 1
libraries/extensions/ros2-bridge/Cargo.toml View File

@@ -2,6 +2,8 @@
name = "dora-ros2-bridge"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "ROS2 bridge for dora-rs"
links = "dora-ros2-bridge"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -21,7 +23,7 @@ ros2-client = "0.8.0"
rustdds = "0.11.0"
eyre = { version = "0.6.8", optional = true }
tokio = { version = "1.29.1", features = ["full"], optional = true }
dora-daemon = { path = "../../../binaries/daemon", optional = true }
dora-daemon = { workspace = true, optional = true }
tracing = "0.1.37"
tracing-subscriber = "0.3.17"
flume = "0.11.0"


+ 1
- 0
libraries/extensions/ros2-bridge/msg-gen/Cargo.toml View File

@@ -2,6 +2,7 @@
name = "dora-ros2-bridge-msg-gen"
version.workspace = true
edition.workspace = true
description = "Message generation for ROS2 bridge"
authors = ["Yuma Hiramatsu <yuma.hiramatsu@gmail.com>"]
license = "Apache-2.0"



Loading…
Cancel
Save