Thanks to visit codestin.com
Credit goes to github.com

Skip to content

>= and testnetwallet password fix #326

>= and testnetwallet password fix

>= and testnetwallet password fix #326

Workflow file for this run

name: Build check
on:
push:
branches:
- "**"
tags-ignore:
- "*" # We don't want this to run on release
pull_request:
jobs:
build-windows:
name: Windows
runs-on: windows-2022
env:
BOOST_ROOT: ""
steps:
- name: Cache vcpkg (Windows)
uses: actions/cache@v4
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-check-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-vcpkg-check-
${{ runner.os }}-vcpkg-
- uses: actions/checkout@v4
- name: Prepare version
shell: pwsh
id: setup
run: |
$os="windows"
$xfg_version="${{ github.sha }}".SubString(0,7)
$release_name="xfg-cli-$os-dev-$xfg_version"
echo "release_name=${release_name}" >> $env:GITHUB_OUTPUT
- name: Install msbuild
uses: microsoft/[email protected]
- name: Install Boost via Chocolatey
shell: pwsh
run: |
Write-Host "Installing Boost via Chocolatey..."
choco install boost-msvc-14.3 -y
Write-Host "Locating Boost installation..."
$boostPath = Get-ChildItem "C:\local" -Directory -Filter "boost_*" -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName
if ($boostPath) {
Write-Host "Found Boost at: $boostPath"
echo "BOOST_ROOT=$boostPath" >> $env:GITHUB_ENV
}
else {
Write-Error "Boost installation not found in C:\local!"
Get-ChildItem "C:\local" -ErrorAction SilentlyContinue
exit 1
}
- name: Verify Boost Installation
shell: pwsh
run: |
Write-Host "Verifying Boost installation..."
Write-Host "BOOST_ROOT: $env:BOOST_ROOT"
if (-not (Test-Path $env:BOOST_ROOT)) {
Write-Error "BOOST_ROOT path does not exist: $env:BOOST_ROOT"
exit 1
}
Write-Host "✓ BOOST_ROOT exists"
Write-Host "Contents:"
Get-ChildItem $env:BOOST_ROOT | Select-Object -First 10
if (Test-Path "$env:BOOST_ROOT\boost") {
Write-Host "✓ boost subdirectory found"
} else {
Write-Warning "boost subdirectory not found!"
}
# Verify FuegoTor directory exists
Write-Host "Verifying repository structure..."
Write-Host "Source directory contents:"
Get-ChildItem src | Select-Object -First 15
if (-not (Test-Path "src/FuegoTor")) {
Write-Error "FuegoTor directory not found!"
Write-Host "All directories in src:"
Get-ChildItem src -Directory
exit 1
} else {
Write-Host "✓ FuegoTor directory found"
Write-Host "FuegoTor directory contents:"
Get-ChildItem src/FuegoTor
}
- name: Build
shell: pwsh
id: build
run: |
$ErrorActionPreference = "Stop"
$build_folder = "build"
$sha = "${{ github.sha }}"
$xfg_ver = $sha.SubString(0,7)
$release_name="fuego-cli-win64-v$xfg_ver"
Write-Host "Creating build folder..."
# Initialize vcpkg
if (-not (Test-Path "C:/vcpkg/vcpkg.exe")) {
Write-Host "Initializing vcpkg..."
git clone https://github.com/Microsoft/vcpkg.git C:/vcpkg
cd C:/vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
cd ..
}
# Install jsoncpp, Boost, and ICU via vcpkg for consistency
Write-Host "Installing jsoncpp, Boost, and ICU via vcpkg..."
C:/vcpkg/vcpkg.exe install --triplet x64-windows jsoncpp boost-date-time boost-filesystem boost-program-options boost-regex boost-system boost-thread icu
if ($LASTEXITCODE -ne 0) { throw "vcpkg installation failed" }
# Verify ICU installation
Write-Host "Verifying ICU installation..."
C:/vcpkg/vcpkg.exe list | findstr icu
$icuPath = Get-ChildItem "C:/vcpkg/installed/x64-windows" -Filter "*icu*" -Directory
if ($icuPath) {
Write-Host "Found ICU at: $($icuPath.FullName)"
Get-ChildItem "$($icuPath.FullName)/lib" -Filter "icu*.dll" | Select-Object -First 5
} else {
Write-Warning "ICU not found in vcpkg installation"
}
# Configure CMake with vcpkg toolchain and explicit source/build directories
Write-Host "Configuring CMake with vcpkg toolchain..."
cmake -S . -B "$build_folder" `
-G "Visual Studio 17 2022" -A x64 `
-DBUILD_TESTS=ON `
-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
-DCMAKE_POLICY_DEFAULT_CMP0167=OLD `
-DICU_ROOT="C:/vcpkg/installed/x64-windows" `
-DICU_INCLUDE_DIR="C:/vcpkg/installed/x64-windows/include" `
-DICU_LIBRARY="C:/vcpkg/installed/x64-windows/lib/icuuc.lib" `
-DICU_I18N_LIBRARY="C:/vcpkg/installed/x64-windows/lib/icuin.lib" `
-DICU_DATA_LIBRARY="C:/vcpkg/installed/x64-windows/lib/icudt.lib"
if ($LASTEXITCODE -ne 0) { throw "CMake configuration failed" }
cd "$build_folder"
msbuild fuegoX.sln /p:Configuration=Release /m /v:minimal
if ($LASTEXITCODE -ne 0) { throw "Build failed" }
cd src\Release
Compress-Archive -Path *.exe -DestinationPath "$release_name.zip"
$sha256 = (Get-FileHash "$release_name.zip").Hash
$asset_path = "./$build_folder/src/Release/$release_name.zip"
mkdir "$release_name" -Force
cp *.exe "$release_name/"
echo "sha256=${sha256}" >> $env:GITHUB_OUTPUT
echo "release_name=${release_name}.zip" >> $env:GITHUB_OUTPUT
echo "asset_path=${asset_path}" >> $env:GITHUB_OUTPUT
echo "xfg_version=${xfg_version}" >> $env:GITHUB_OUTPUT
echo "artifact_path=$build_folder/src/Release/$release_name" >> $env:GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-ubuntu22:
name: Ubuntu 22.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build
id: build
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential libboost-all-dev cmake libjsoncpp-dev
# Verify repository structure
echo "=== Verifying repository structure ==="
echo "Source directory contents:"
ls -la src | head -20
if [ ! -d "src/FuegoTor" ]; then
echo "ERROR: FuegoTor directory not found!"
echo "All directories in src:"
ls -la src
exit 1
else
echo "✓ FuegoTor directory found"
echo "FuegoTor directory contents:"
ls -la src/FuegoTor
fi
# Debug JSON installation locations
echo "=== JSONcpp Installation Debug ==="
echo "Looking for json.h files:"
find /usr -name "json.h" -type f 2>/dev/null | head -5
echo "libjsoncpp-dev package contents (first 20 lines):"
dpkg -L libjsoncpp-dev 2>/dev/null | head -20
# Create system-level symlink for jsoncpp
echo "=== Setting up jsoncpp symlinks ==="
if [ -d "/usr/include/jsoncpp" ] && [ ! -d "/usr/include/json" ]; then
sudo ln -sf /usr/include/jsoncpp/json /usr/include/json
echo "Created system symlink: /usr/include/json -> /usr/include/jsoncpp/json"
elif [ -d "/usr/include/x86_64-linux-gnu/jsoncpp" ] && [ ! -d "/usr/include/json" ]; then
sudo ln -sf /usr/include/x86_64-linux-gnu/jsoncpp/json /usr/include/json
echo "Created system symlink: /usr/include/json -> /usr/include/x86_64-linux-gnu/jsoncpp/json"
elif [ ! -d "/usr/include/json" ]; then
echo "Creating manual directory /usr/include/json"
sudo mkdir -p /usr/include/json
if [ -f "/usr/include/jsoncpp/json/json.h" ]; then
sudo cp -r /usr/include/jsoncpp/json/* /usr/include/json/
echo "Copied jsoncpp headers to /usr/include/json"
elif [ -f "/usr/include/x86_64-linux-gnu/jsoncpp/json/json.h" ]; then
sudo cp -r /usr/include/x86_64-linux-gnu/jsoncpp/json/* /usr/include/json/
echo "Copied multiarch jsoncpp headers to /usr/include/json"
fi
fi
# Verify the headers are accessible
echo "=== Verification ==="
if [ -f "/usr/include/json/json.h" ]; then
echo "SUCCESS: Found /usr/include/json/json.h"
ls -la /usr/include/json/ | head -5
else
echo "ERROR: Could not find or create /usr/include/json/json.h"
echo "All include dirs containing json:"
find /usr/include -type d -name "*json*" 2>/dev/null
fi
build_folder="build/debug"
xfg_ver=${GITHUB_SHA::7}
xfg_ver_folder=$(echo $xfg_ver | sed 's/\.//g')
release_name=fuego-cli-ubuntu-2204-dev"$xfg_ver"
mkdir -p "$build_folder"
cd "$build_folder"
cmake ../.. -DCMAKE_BUILD_TYPE=Debug
make -j$(nproc)
mkdir -p "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
echo "release_name=${release_name}.tar.gz" >> $GITHUB_OUTPUT
echo "artifact_path=$build_folder/$release_name" >> $GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-ubuntu24:
name: Ubuntu 24.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build
id: build
run: |
set -e
sudo apt-get update
sudo apt-get install -y build-essential libboost-all-dev cmake libjsoncpp-dev
# Verify repository structure
echo "=== Verifying repository structure ==="
echo "Source directory contents:"
ls -la src | head -20
if [ ! -d "src/FuegoTor" ]; then
echo "ERROR: FuegoTor directory not found!"
echo "All directories in src:"
ls -la src
exit 1
else
echo "✓ FuegoTor directory found"
echo "FuegoTor directory contents:"
ls -la src/FuegoTor
fi
# Debug JSON installation locations
echo "=== JSONcpp Installation Debug ==="
echo "Looking for json.h files:"
find /usr -name "json.h" -type f 2>/dev/null | head -5
echo "libjsoncpp-dev package contents (first 20 lines):"
dpkg -L libjsoncpp-dev 2>/dev/null | head -20
# Create system-level symlink for jsoncpp
echo "=== Setting up jsoncpp symlinks ==="
if [ -d "/usr/include/jsoncpp" ] && [ ! -d "/usr/include/json" ]; then
sudo ln -sf /usr/include/jsoncpp/json /usr/include/json
echo "Created system symlink: /usr/include/json -> /usr/include/jsoncpp/json"
elif [ -d "/usr/include/x86_64-linux-gnu/jsoncpp" ] && [ ! -d "/usr/include/json" ]; then
sudo ln -sf /usr/include/x86_64-linux-gnu/jsoncpp/json /usr/include/json
echo "Created system symlink: /usr/include/json -> /usr/include/x86_64-linux-gnu/jsoncpp/json"
elif [ ! -d "/usr/include/json" ]; then
echo "Creating manual directory /usr/include/json"
sudo mkdir -p /usr/include/json
if [ -f "/usr/include/jsoncpp/json/json.h" ]; then
sudo cp -r /usr/include/jsoncpp/json/* /usr/include/json/
echo "Copied jsoncpp headers to /usr/include/json"
elif [ -f "/usr/include/x86_64-linux-gnu/jsoncpp/json/json.h" ]; then
sudo cp -r /usr/include/x86_64-linux-gnu/jsoncpp/json/* /usr/include/json/
echo "Copied multiarch jsoncpp headers to /usr/include/json"
fi
fi
# Verify the headers are accessible
echo "=== Verification ==="
if [ -f "/usr/include/json/json.h" ]; then
echo "SUCCESS: Found /usr/include/json/json.h"
ls -la /usr/include/json/ | head -5
else
echo "ERROR: Could not find or create /usr/include/json/json.h"
echo "All include dirs containing json:"
find /usr/include -type d -name "*json*" 2>/dev/null
fi
build_folder="build/debug"
xfg_ver=${GITHUB_SHA::7}
xfg_ver_folder=$(echo $xfg_ver | sed 's/\.//g')
release_name=fuego-cli-ubuntu-2404-dev"$xfg_ver"
mkdir -p "$build_folder"
cd "$build_folder"
cmake ../.. -DCMAKE_BUILD_TYPE=Debug
make -j$(nproc)
mkdir -p "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
echo "release_name=${release_name}.tar.gz" >> $GITHUB_OUTPUT
echo "artifact_path=$build_folder/$release_name" >> $GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
name: macOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-12
arch: intel
arch_flag: x86_64
- os: macos-14
arch: apple
arch_flag: arm64
steps:
- uses: actions/checkout@v4
- name: Install dependencies and verify repository
run: |
set -e
brew install gcc boost cmake jsoncpp
# Verify repository structure
echo "=== Verifying repository structure ==="
echo "Source directory contents:"
ls -la src | head -20
if [ ! -d "src/FuegoTor" ]; then
echo "ERROR: FuegoTor directory not found!"
echo "All directories in src:"
ls -la src
exit 1
else
echo "✓ FuegoTor directory found"
echo "FuegoTor directory contents:"
ls -la src/FuegoTor
fi
- name: Build
id: build
run: |
set -e
build_folder="build/"
xfg_ver=${GITHUB_SHA::7}
xfg_ver_folder=$(echo $xfg_ver | sed 's/\.//g')
release_name=fuego-cli-macos-${{ matrix.arch }}-dev"$xfg_ver"
mkdir "$build_folder"
cd "$build_folder"
cmake -S .. -B . -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch_flag }}
make -j$(sysctl -n hw.ncpu)
mkdir "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && strip "$f" && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
zip -r "$release_name".zip "$release_name"
sha256=$(shasum -a 256 "$release_name".zip | awk '{print toupper($1)}')
artifact_path="$build_folder/$release_name"
asset_path="./$build_folder$release_name.zip"
echo "sha256=${sha256}" >> $GITHUB_OUTPUT
echo "release_name=${release_name}.zip" >> $GITHUB_OUTPUT
echo "asset_path=${asset_path}" >> $GITHUB_OUTPUT
echo "xfg_version=${xfg_ver}" >> $GITHUB_OUTPUT
echo "artifact_path=${artifact_path}" >> $GITHUB_OUTPUT
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}