-
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
Changes from all commits
45435e5
24e56e3
a6403ae
54f1cff
234cb38
5ab9ce7
ba438f1
f3def63
32a82d6
86813fd
11b9400
049d17f
ba2bc21
adb9475
94328fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,29 +7,116 @@ on: | |||||||||
|
|
||||||||||
| env: | ||||||||||
| IMAGE_NAME: monadfoundation/soteria | ||||||||||
| CARGO_TERM_COLOR: always | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| artifacts: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| binaries: | ||||||||||
| name: Build ${{ matrix.platform.name }} | ||||||||||
| runs-on: ${{ matrix.platform.runner }} | ||||||||||
| strategy: | ||||||||||
| fail-fast: false | ||||||||||
| matrix: | ||||||||||
| platform: | ||||||||||
| - name: linux x86_64 | ||||||||||
| runner: ubuntu-latest | ||||||||||
| target: x86_64-unknown-linux-gnu | ||||||||||
| artifact: soteria-linux-x86_64 | ||||||||||
|
|
||||||||||
| - name: linux arm64 | ||||||||||
| runner: ubuntu-24.04-arm | ||||||||||
| target: aarch64-unknown-linux-gnu | ||||||||||
| artifact: soteria-linux-arm64 | ||||||||||
|
|
||||||||||
QEDK marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| # macOS Intel | ||||||||||
| - name: macos x86_64 | ||||||||||
| runner: macos-15-intel | ||||||||||
QEDK marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| target: x86_64-apple-darwin | ||||||||||
| artifact: soteria-darwin-x86_64 | ||||||||||
|
|
||||||||||
| # macOS Apple Silicon | ||||||||||
| - name: macos arm64 | ||||||||||
| runner: macos-26 | ||||||||||
QEDK marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| target: aarch64-apple-darwin | ||||||||||
| artifact: soteria-darwin-arm64 | ||||||||||
QEDK marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| # Windows x86_64 | ||||||||||
| - name: windows x86_64 | ||||||||||
| runner: windows-latest | ||||||||||
| target: x86_64-pc-windows-msvc | ||||||||||
| artifact: soteria-windows-x86_64 | ||||||||||
|
|
||||||||||
| # Windows ARM64 | ||||||||||
| - name: windows arm64 | ||||||||||
| runner: windows-11-arm | ||||||||||
| target: aarch64-pc-windows-msvc | ||||||||||
| artifact: soteria-windows-arm64 | ||||||||||
QEDK marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
|
Comment on lines
+49
to
+53
|
||||||||||
| - name: windows arm64 | |
| runner: windows-11-arm | |
| target: aarch64-pc-windows-msvc | |
| artifact: soteria-windows-arm64 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| name = "soteria" | ||
| authors = ["QEDK <[email protected]>"] | ||
| license = "Apache-2.0" | ||
| version = "0.1.0" | ||
| version = "0.1.6" | ||
| edition = "2024" | ||
|
|
||
| [dependencies] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,201 @@ | ||||||||||||||||||||||||||||||||||||||||
| name: 'run soteria CLI' | ||||||||||||||||||||||||||||||||||||||||
| description: 'uses the soteria CLI to validate safe transaction hashes in JSON log files' | ||||||||||||||||||||||||||||||||||||||||
| author: 'Monad Foundation' | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| branding: | ||||||||||||||||||||||||||||||||||||||||
| icon: 'shield' | ||||||||||||||||||||||||||||||||||||||||
| color: 'purple' | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||
| directory: | ||||||||||||||||||||||||||||||||||||||||
| description: 'Path to the directory containing JSON files to validate' | ||||||||||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||||||||||
| version: | ||||||||||||||||||||||||||||||||||||||||
| description: 'Version of Soteria to use (e.g., "v0.1.5" or "latest")' | ||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||
| default: 'latest' | ||||||||||||||||||||||||||||||||||||||||
| github-token: | ||||||||||||||||||||||||||||||||||||||||
| description: 'GitHub token for API requests (to avoid rate limiting)' | ||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||
| default: ${{ github.token }} | ||||||||||||||||||||||||||||||||||||||||
| fail-on-error: | ||||||||||||||||||||||||||||||||||||||||
| description: 'Whether to fail the workflow if validation errors are found' | ||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||
| default: 'true' | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||||||||||||||||||||
| validation-result: | ||||||||||||||||||||||||||||||||||||||||
| description: 'The result of the validation (success or failure)' | ||||||||||||||||||||||||||||||||||||||||
| value: ${{ steps.run-soteria.outputs.result }} | ||||||||||||||||||||||||||||||||||||||||
| soteria-version: | ||||||||||||||||||||||||||||||||||||||||
| description: 'The version of Soteria that was used' | ||||||||||||||||||||||||||||||||||||||||
| value: ${{ steps.download.outputs.tag_name }} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| runs: | ||||||||||||||||||||||||||||||||||||||||
| using: 'composite' | ||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||
| - name: Determine platform | ||||||||||||||||||||||||||||||||||||||||
| id: platform | ||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| OS="${{ runner.os }}" | ||||||||||||||||||||||||||||||||||||||||
| ARCH="${{ runner.arch }}" | ||||||||||||||||||||||||||||||||||||||||
| case "$OS" in | ||||||||||||||||||||||||||||||||||||||||
| Linux) | ||||||||||||||||||||||||||||||||||||||||
| case "$ARCH" in | ||||||||||||||||||||||||||||||||||||||||
| X64) | ||||||||||||||||||||||||||||||||||||||||
| echo "target=x86_64-unknown-linux-gnu" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "asset_pattern=soteria-*linux*x86_64*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "fallback_pattern=soteria*linux*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| ARM64) | ||||||||||||||||||||||||||||||||||||||||
| echo "target=aarch64-unknown-linux-gnu" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "asset_pattern=soteria-*linux*aarch64*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "fallback_pattern=soteria*linux*arm*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| *) | ||||||||||||||||||||||||||||||||||||||||
| echo "::error::Unsupported architecture: $ARCH" | ||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| macOS) | ||||||||||||||||||||||||||||||||||||||||
| case "$ARCH" in | ||||||||||||||||||||||||||||||||||||||||
| X64) | ||||||||||||||||||||||||||||||||||||||||
| echo "target=x86_64-apple-darwin" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "asset_pattern=soteria-*darwin*x86_64*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "fallback_pattern=soteria*darwin*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| ARM64) | ||||||||||||||||||||||||||||||||||||||||
| echo "target=aarch64-apple-darwin" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "asset_pattern=soteria-*darwin*aarch64*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| echo "fallback_pattern=soteria*darwin*arm*" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| *) | ||||||||||||||||||||||||||||||||||||||||
| echo "::error::Unsupported architecture: $ARCH" | ||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| Windows) | ||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||
|
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 | |
| 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
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" |
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 |
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 |
Uh oh!
There was an error while loading. Please reload this page.