Skip to content

Commit 2585863

Browse files
Checkpoint before follow-up message
Co-authored-by: clinchmtnmojo <clinchmtnmojo@gmail.com>
1 parent ce77f60 commit 2585863

File tree

3 files changed

+146
-11
lines changed

3 files changed

+146
-11
lines changed

.github/workflows/flutter-desktop.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,18 @@ jobs:
4747
- name: Enable macOS desktop support
4848
run: flutter config --enable-macos-desktop
4949

50-
- name: Download xfg-stark-cli
51-
run: |
52-
curl -L -o xfg-stark-cli-macos "https://github.com/ColinRitman/xfgwin/releases/download/v0.8.8/xfg-stark-cli-macos"
53-
chmod +x xfg-stark-cli-macos
54-
mkdir -p assets/bin
55-
mv xfg-stark-cli-macos assets/bin/
50+
- name: Download required binaries
51+
run: ./scripts/ensure-binaries.sh
5652

5753
- name: Install dependencies
5854
run: flutter pub get
5955

56+
- name: Run tests
57+
run: flutter test
58+
59+
- name: Analyze code
60+
run: flutter analyze
61+
6062
- name: Build macOS desktop app
6163
run: flutter build macos --release
6264

@@ -97,15 +99,18 @@ jobs:
9799
- name: Enable Windows desktop support
98100
run: flutter config --enable-windows-desktop
99101

100-
- name: Download xfg-stark-cli
101-
run: |
102-
curl -L -o xfg-stark-cli-windows.exe "https://github.com/ColinRitman/xfgwin/releases/download/v0.8.8/xfg-stark-cli-windows.exe"
103-
New-Item -ItemType Directory -Force -Path assets\bin
104-
Move-Item xfg-stark-cli-windows.exe assets\bin\xfg-stark-cli.exe
102+
- name: Download required binaries
103+
run: ./scripts/ensure-binaries.sh
105104

106105
- name: Install dependencies
107106
run: flutter pub get
108107

108+
- name: Run tests
109+
run: flutter test
110+
111+
- name: Analyze code
112+
run: flutter analyze
113+
109114
- name: Build Windows desktop app
110115
run: flutter build windows --release
111116

@@ -166,6 +171,12 @@ jobs:
166171
- name: Install dependencies
167172
run: flutter pub get
168173

174+
- name: Run tests
175+
run: flutter test
176+
177+
- name: Analyze code
178+
run: flutter analyze
179+
169180
- name: Build Linux desktop app (GLIBC 2.35)
170181
run: |
171182
flutter build linux --release
@@ -271,6 +282,12 @@ jobs:
271282
- name: Install dependencies
272283
run: flutter pub get
273284

285+
- name: Run tests
286+
run: flutter test
287+
288+
- name: Analyze code
289+
run: flutter analyze
290+
274291
- name: Build Linux desktop app (Latest)
275292
run: flutter build linux --release
276293

.github/workflows/ios-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
- name: Install dependencies
7474
run: flutter pub get
7575

76+
- name: Download required binaries
77+
run: ./scripts/ensure-binaries.sh
78+
7679
- name: Run tests
7780
run: flutter test
7881

scripts/ensure-binaries.sh

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/bin/bash
2+
3+
# XF₲ Wallet Binary Download Script
4+
# This script ensures all required binaries are downloaded before running tests or builds
5+
6+
set -e
7+
8+
echo "📦 Ensuring XF₲ Wallet binaries are available"
9+
echo "============================================="
10+
11+
# Colors for output
12+
RED='\033[0;31m'
13+
GREEN='\033[0;32m'
14+
YELLOW='\033[1;33m'
15+
BLUE='\033[0;34m'
16+
NC='\033[0m' # No Color
17+
18+
# Function to print colored output
19+
print_status() {
20+
echo -e "${BLUE}[INFO]${NC} $1"
21+
}
22+
23+
print_success() {
24+
echo -e "${GREEN}[SUCCESS]${NC} $1"
25+
}
26+
27+
print_warning() {
28+
echo -e "${YELLOW}[WARNING]${NC} $1"
29+
}
30+
31+
print_error() {
32+
echo -e "${RED}[ERROR]${NC} $1"
33+
}
34+
35+
# Create assets/bin directory if it doesn't exist
36+
mkdir -p assets/bin
37+
38+
# Download xfg-stark-cli binaries for all platforms
39+
print_status "Downloading xfg-stark-cli binaries..."
40+
41+
# Linux binary
42+
if [ ! -f "assets/bin/xfg-stark-cli-linux" ]; then
43+
print_status "Downloading xfg-stark-cli-linux..."
44+
curl -L -o xfg-stark-cli-linux "https://github.com/ColinRitman/xfgwin/releases/download/v0.8.8/xfg-stark-cli-linux"
45+
chmod +x xfg-stark-cli-linux
46+
mv xfg-stark-cli-linux assets/bin/
47+
print_success "xfg-stark-cli-linux downloaded"
48+
else
49+
print_success "xfg-stark-cli-linux already exists"
50+
fi
51+
52+
# macOS binary
53+
if [ ! -f "assets/bin/xfg-stark-cli-macos" ]; then
54+
print_status "Downloading xfg-stark-cli-macos..."
55+
curl -L -o xfg-stark-cli-macos "https://github.com/ColinRitman/xfgwin/releases/download/v0.8.8/xfg-stark-cli-macos"
56+
chmod +x xfg-stark-cli-macos
57+
mv xfg-stark-cli-macos assets/bin/
58+
print_success "xfg-stark-cli-macos downloaded"
59+
else
60+
print_success "xfg-stark-cli-macos already exists"
61+
fi
62+
63+
# Windows binary
64+
if [ ! -f "assets/bin/xfg-stark-cli-windows.exe" ]; then
65+
print_status "Downloading xfg-stark-cli-windows.exe..."
66+
curl -L -o xfg-stark-cli-windows.exe "https://github.com/ColinRitman/xfgwin/releases/download/v0.8.8/xfg-stark-cli-windows.exe"
67+
mv xfg-stark-cli-windows.exe assets/bin/
68+
print_success "xfg-stark-cli-windows.exe downloaded"
69+
else
70+
print_success "xfg-stark-cli-windows.exe already exists"
71+
fi
72+
73+
# Verify all binaries are present and executable
74+
print_status "Verifying binaries..."
75+
76+
required_binaries=(
77+
"assets/bin/xfg-stark-cli-linux"
78+
"assets/bin/xfg-stark-cli-macos"
79+
"assets/bin/xfg-stark-cli-windows.exe"
80+
)
81+
82+
all_present=true
83+
for binary in "${required_binaries[@]}"; do
84+
if [ -f "$binary" ]; then
85+
if [[ "$binary" != *.exe ]] && [ ! -x "$binary" ]; then
86+
chmod +x "$binary"
87+
fi
88+
print_success "$binary is present and ready"
89+
else
90+
print_error "$binary is missing"
91+
all_present=false
92+
fi
93+
done
94+
95+
if [ "$all_present" = true ]; then
96+
print_success "🎉 All required binaries are available!"
97+
echo ""
98+
echo "Binaries ready for:"
99+
echo "- Flutter tests"
100+
echo "- Cross-platform builds"
101+
echo "- CI/CD pipelines"
102+
else
103+
print_error "❌ Some binaries are missing. Please check the download process."
104+
exit 1
105+
fi
106+
107+
# Show binary sizes
108+
echo ""
109+
print_status "Binary information:"
110+
for binary in "${required_binaries[@]}"; do
111+
if [ -f "$binary" ]; then
112+
size=$(du -h "$binary" | cut -f1)
113+
echo " $binary: $size"
114+
fi
115+
done

0 commit comments

Comments
 (0)