-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement GitHub action for soteria #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.ymldefining 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" |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
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.
| BINARY="$INSTALL_DIR/bin/soteria" | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| BINARY="$INSTALL_DIR/bin/soteria.exe" | |
| else | |
| BINARY="$INSTALL_DIR/bin/soteria" | |
| fi |
| 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 |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
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.
| 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 |
| cp "$BINARY" "$INSTALL_DIR/soteria" | ||
| BINARY="$INSTALL_DIR/soteria" |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
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.
| 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 |
| # 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" |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
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).
| source "$HOME/.cargo/env" | |
| . "$HOME/.cargo/env" |
action.ymlfor usage from other repos