Skip to content

Conversation

@QEDK
Copy link
Member

@QEDK QEDK commented Dec 12, 2025

  • adds action.yml for usage from other repos
  • fixes a bug where binaries were not being uploaded in the release
  • bumps some action versions
  • generates binaries for all available environments

@QEDK QEDK self-assigned this Dec 12, 2025
Copilot AI review requested due to automatic review settings December 12, 2025 00:41
@QEDK QEDK added the enhancement New feature or request label Dec 12, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a GitHub Action for the soteria CLI tool, enabling other repositories to use soteria for validating safe transaction hashes in JSON log files. It also enhances the release workflow to build binaries for multiple platforms and fixes issues with binary uploads.

Key changes:

  • Adds action.yml defining a composite action that downloads/builds soteria and runs validation
  • Refactors release workflow to build cross-platform binaries using a matrix strategy
  • Updates several GitHub Actions to newer versions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

File Description
action.yml New composite action for running soteria CLI with platform detection, binary download/build fallback, and validation execution
.github/workflows/release.yml Refactored to use matrix builds for multiple platforms (Linux, macOS, Windows on x86_64 and ARM64), added binary artifact upload to releases
.github/workflows/ci.yml Updated actions/checkout version from v4 to v6

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Install soteria from source
cargo install --git https://github.com/monad-developers/soteria.git --root "$INSTALL_DIR"
BINARY="$INSTALL_DIR/bin/soteria"
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build command on line 149 will produce a binary at '$INSTALL_DIR/bin/soteria.exe' on Windows, not '$INSTALL_DIR/bin/soteria'. The code should handle the Windows .exe extension when setting BINARY path after cargo install.

Suggested change
BINARY="$INSTALL_DIR/bin/soteria"
if [ "${{ runner.os }}" = "Windows" ]; then
BINARY="$INSTALL_DIR/bin/soteria.exe"
else
BINARY="$INSTALL_DIR/bin/soteria"
fi

Copilot uses AI. Check for mistakes.
Comment on lines +82 to +84
echo "target=x86_64-pc-windows-msvc" >> $GITHUB_OUTPUT
echo "asset_pattern=soteria-*windows*x86_64*" >> $GITHUB_OUTPUT
echo "fallback_pattern=soteria*windows*" >> $GITHUB_OUTPUT
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows platform detection doesn't handle ARM64 architecture. The case statement only sets x86_64 target regardless of the ARCH value, which means Windows ARM64 runners would incorrectly use the x86_64 target instead of aarch64-pc-windows-msvc.

Suggested change
echo "target=x86_64-pc-windows-msvc" >> $GITHUB_OUTPUT
echo "asset_pattern=soteria-*windows*x86_64*" >> $GITHUB_OUTPUT
echo "fallback_pattern=soteria*windows*" >> $GITHUB_OUTPUT
case "$ARCH" in
X64)
echo "target=x86_64-pc-windows-msvc" >> $GITHUB_OUTPUT
echo "asset_pattern=soteria-*windows*x86_64*" >> $GITHUB_OUTPUT
echo "fallback_pattern=soteria*windows*" >> $GITHUB_OUTPUT
;;
ARM64)
echo "target=aarch64-pc-windows-msvc" >> $GITHUB_OUTPUT
echo "asset_pattern=soteria-*windows*aarch64*" >> $GITHUB_OUTPUT
echo "fallback_pattern=soteria*windows*arm*" >> $GITHUB_OUTPUT
;;
*)
echo "::error::Unsupported architecture: $ARCH"
exit 1
;;
esac

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +152
cp "$BINARY" "$INSTALL_DIR/soteria"
BINARY="$INSTALL_DIR/soteria"
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback pattern for Windows on line 151 will fail because it copies to 'soteria' without the .exe extension, but on Windows the binary is named 'soteria.exe'. This should append .exe for Windows platforms to match the actual binary name.

Suggested change
cp "$BINARY" "$INSTALL_DIR/soteria"
BINARY="$INSTALL_DIR/soteria"
if [ "${{ runner.os }}" = "Windows" ]; then
cp "$BINARY" "$INSTALL_DIR/soteria.exe"
BINARY="$INSTALL_DIR/soteria.exe"
else
cp "$BINARY" "$INSTALL_DIR/soteria"
BINARY="$INSTALL_DIR/soteria"
fi

Copilot uses AI. Check for mistakes.
# Install Rust if needed
if ! command -v cargo &> /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'source' command on line 144 is a bash-specific builtin and may not work in Windows Git Bash or other non-standard shells. Consider using dot notation (. "$HOME/.cargo/env") which is POSIX-compliant, or check if this step should be skipped on Windows entirely since the cargo install fallback doesn't handle Windows properly (see the .exe extension issue on lines 151-152).

Suggested change
source "$HOME/.cargo/env"
. "$HOME/.cargo/env"

Copilot uses AI. Check for mistakes.
@mijovic mijovic merged commit bff1f07 into master Dec 12, 2025
4 checks passed
@mijovic mijovic deleted the feat/qedk branch December 12, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants