Skip to content

Commit 7ad6bb3

Browse files
committed
update workflows
1 parent 1a78918 commit 7ad6bb3

File tree

5 files changed

+282
-428
lines changed

5 files changed

+282
-428
lines changed

.github/APPIMAGE_BUILD_FIX.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# AppImage Build Fix Documentation
2+
3+
## Issue Summary
4+
5+
The Linux GLIBC 2.35 AppImage build was failing with the following error:
6+
7+
```
8+
cp: cannot stat '../../../../app_icon_256.png': No such file or directory
9+
```
10+
11+
## Root Cause
12+
13+
The AppImage creation step in the GitHub Actions workflow had an incorrect relative path to the icon file. The script was running from `build/linux/x64/release/bundle` and trying to access `../../../../app_icon_256.png`, but the correct path requires going up 5 directory levels, not 4.
14+
15+
### Path Analysis
16+
17+
- **Working Directory**: `build/linux/x64/release/bundle`
18+
- **Target File**: `app_icon_256.png` (at project root)
19+
- **Incorrect Path**: `../../../../app_icon_256.png` (4 levels up)
20+
- **Correct Path**: `../../../../../app_icon_256.png` (5 levels up)
21+
22+
### Directory Structure
23+
24+
```
25+
firefly-wallet-official/ ← Project root (where app_icon_256.png is)
26+
├── app_icon_256.png ← Target file
27+
├── build/
28+
│ └── linux/
29+
│ └── x64/
30+
│ └── release/
31+
│ └── bundle/ ← Current working directory
32+
```
33+
34+
## Changes Made
35+
36+
### 1. Fixed Icon Path (`.github/workflows/xfg-wallet-desktop.yml`)
37+
38+
**Before:**
39+
```yaml
40+
cp ../../../../app_icon_256.png fuego_wallet.png
41+
```
42+
43+
**After:**
44+
```yaml
45+
cp ../../../../../app_icon_256.png fuego_wallet.png
46+
```
47+
48+
### 2. Added Error Handling and Fallback
49+
50+
The updated workflow now includes:
51+
52+
- **File existence check** before copying
53+
- **Fallback location** check (assets/icons/)
54+
- **Error message** if icon not found
55+
- **Exit with error** if all locations fail
56+
57+
```bash
58+
if [ -f ../../../../../app_icon_256.png ]; then
59+
cp ../../../../../app_icon_256.png fuego_wallet.png
60+
else
61+
echo "Warning: app_icon_256.png not found, checking alternate locations..."
62+
if [ -f ../../../../../assets/icons/app_icon_256.png ]; then
63+
cp ../../../../../assets/icons/app_icon_256.png fuego_wallet.png
64+
else
65+
echo "Error: Icon file not found!"
66+
exit 1
67+
fi
68+
fi
69+
```
70+
71+
### 3. Created Dedicated Desktop File
72+
73+
Created `linux/xfg-wallet.desktop` with proper formatting:
74+
75+
```desktop
76+
[Desktop Entry]
77+
Version=1.0
78+
Type=Application
79+
Name=XF₲ Wallet
80+
GenericName=Cryptocurrency Wallet
81+
Comment=Privacy-focused cryptocurrency wallet for XF₲
82+
Exec=fuego_wallet
83+
Icon=fuego_wallet
84+
Terminal=false
85+
Categories=Finance;Network;
86+
Keywords=cryptocurrency;wallet;privacy;fuego;xfg;
87+
StartupWMClass=fuego_wallet
88+
StartupNotify=true
89+
```
90+
91+
### 4. Fixed Desktop File Generation
92+
93+
The workflow now:
94+
1. Attempts to copy the dedicated desktop file from `linux/xfg-wallet.desktop`
95+
2. Falls back to generating one inline if the file doesn't exist
96+
3. Properly formats the inline desktop file (previous version had malformed EOF)
97+
98+
## Verification
99+
100+
### Local Testing
101+
102+
To verify the path is correct:
103+
104+
```bash
105+
cd firefly-wallet-official
106+
mkdir -p build/linux/x64/release/bundle
107+
cd build/linux/x64/release/bundle
108+
ls -la ../../../../../app_icon_256.png
109+
```
110+
111+
Expected output: File should be found and displayed.
112+
113+
### CI/CD Testing
114+
115+
The workflow will now:
116+
1. ✅ Find the icon file at the correct path
117+
2. ✅ Copy it to the bundle directory as `fuego_wallet.png`
118+
3. ✅ Create or copy a properly formatted desktop file
119+
4. ✅ Successfully create the AppImage with icon and metadata
120+
121+
## Additional Improvements
122+
123+
### Desktop File Quality
124+
125+
The new desktop file includes:
126+
- **Version**: Specifies Desktop Entry version 1.0
127+
- **GenericName**: Helps with categorization
128+
- **Keywords**: Improves searchability
129+
- **StartupWMClass**: Proper window management
130+
- **StartupNotify**: Visual feedback on launch
131+
- **Terminal=false**: GUI application indicator
132+
133+
### Error Handling
134+
135+
The workflow now provides clear error messages:
136+
- Warns when primary location fails
137+
- Lists alternate locations checked
138+
- Exits with error code if all locations fail
139+
- Makes debugging easier for future issues
140+
141+
## Files Modified
142+
143+
1. **`.github/workflows/xfg-wallet-desktop.yml`**
144+
- Fixed icon path from 4 to 5 directory levels
145+
- Added error handling and fallback logic
146+
- Improved desktop file generation
147+
- Better inline documentation
148+
149+
2. **`linux/xfg-wallet.desktop`** (New File)
150+
- Created dedicated desktop entry file
151+
- Follows FreeDesktop.org standards
152+
- Includes all recommended fields
153+
154+
## Testing Checklist
155+
156+
Before merging, verify:
157+
158+
- [ ] Icon file exists at project root: `app_icon_256.png`
159+
- [ ] Desktop file exists at: `linux/xfg-wallet.desktop`
160+
- [ ] Path calculation is correct (5 levels up from bundle)
161+
- [ ] CI/CD build completes successfully
162+
- [ ] AppImage is created with icon
163+
- [ ] AppImage shows proper metadata when inspected
164+
165+
## Future Recommendations
166+
167+
### Option 1: Use Absolute Path (Safer)
168+
Instead of relative paths, use `$GITHUB_WORKSPACE`:
169+
170+
```bash
171+
cp $GITHUB_WORKSPACE/app_icon_256.png fuego_wallet.png
172+
```
173+
174+
### Option 2: Copy Icon During Build
175+
Add icon to bundle during Flutter build:
176+
177+
```yaml
178+
- name: Copy icon to bundle
179+
run: |
180+
cp app_icon_256.png build/linux/x64/release/bundle/fuego_wallet.png
181+
```
182+
183+
### Option 3: Include in Assets
184+
Add icon to Flutter assets and reference from there:
185+
186+
```yaml
187+
flutter:
188+
assets:
189+
- app_icon_256.png
190+
```
191+
192+
## Related Issues
193+
194+
- Previous GLIBC error was unrelated (system library compatibility)
195+
- This fix addresses only the AppImage icon/desktop file issue
196+
- GLIBC compatibility is handled by the tar.gz artifacts
197+
198+
## Status
199+
200+
- **Fixed**: 2024-11-08
201+
- **Tested**: Path verified locally
202+
- **Ready**: For CI/CD deployment
203+
- **Workflow**: `xfg-wallet-desktop.yml`
204+
- **Job**: `build-linux-compat` (GLIBC 2.35)
205+
206+
## Contact
207+
208+
For issues or questions about this fix, refer to:
209+
- Build logs in GitHub Actions
210+
- `BUILD_FIX_SUMMARY.md` - Dart compilation fixes
211+
- `LINUX_BUILD_FIXED.md` - General Linux build reference

.github/workflows/xfg-wallet-desktop.yml

Lines changed: 58 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ name: XF₲ Wallet Desktop Build & Release
22

33
on:
44
push:
5-
branches: [ main, master ]
5+
branches: [main, master]
66
paths:
7-
- 'lib/**'
8-
- 'android/**'
9-
- 'ios/**'
10-
- 'macos/**'
11-
- 'windows/**'
12-
- 'linux/**'
13-
- 'pubspec.yaml'
14-
- '.github/workflows/flutter-desktop.yml'
7+
- "lib/**"
8+
- "android/**"
9+
- "ios/**"
10+
- "macos/**"
11+
- "windows/**"
12+
- "linux/**"
13+
- "pubspec.yaml"
14+
- ".github/workflows/flutter-desktop.yml"
1515
pull_request:
16-
branches: [ main, master ]
16+
branches: [main, master]
1717
paths:
18-
- 'lib/**'
19-
- 'android/**'
20-
- 'ios/**'
21-
- 'macos/**'
22-
- 'windows/**'
23-
- 'linux/**'
24-
- 'pubspec.yaml'
25-
- '.github/workflows/flutter-desktop.yml'
18+
- "lib/**"
19+
- "android/**"
20+
- "ios/**"
21+
- "macos/**"
22+
- "windows/**"
23+
- "linux/**"
24+
- "pubspec.yaml"
25+
- ".github/workflows/flutter-desktop.yml"
2626
workflow_dispatch:
2727
release:
2828
types: [published]
@@ -41,8 +41,8 @@ jobs:
4141
- name: Set up Flutter
4242
uses: subosito/flutter-action@v2
4343
with:
44-
flutter-version: '3.24.0'
45-
channel: 'stable'
44+
flutter-version: "3.24.0"
45+
channel: "stable"
4646

4747
- name: Install Rust
4848
uses: dtolnay/rust-toolchain@stable
@@ -128,8 +128,8 @@ jobs:
128128
- name: Set up Flutter
129129
uses: subosito/flutter-action@v2
130130
with:
131-
flutter-version: '3.24.0'
132-
channel: 'stable'
131+
flutter-version: "3.24.0"
132+
channel: "stable"
133133

134134
- name: Install Rust
135135
uses: dtolnay/rust-toolchain@stable
@@ -213,8 +213,8 @@ jobs:
213213
- name: Set up Flutter
214214
uses: subosito/flutter-action@v2
215215
with:
216-
flutter-version: '3.24.0'
217-
channel: 'stable'
216+
flutter-version: "3.24.0"
217+
channel: "stable"
218218

219219
- name: Install Rust
220220
uses: dtolnay/rust-toolchain@stable
@@ -302,18 +302,40 @@ jobs:
302302
curl -LO https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
303303
chmod +x appimagetool-x86_64.AppImage
304304
# Copy icon file for AppImage
305-
cp ../../../../app_icon_256.png fuego_wallet.png
305+
if [ -f ../../../../../app_icon_256.png ]; then
306+
cp ../../../../../app_icon_256.png fuego_wallet.png
307+
else
308+
echo "Warning: app_icon_256.png not found, checking alternate locations..."
309+
if [ -f ../../../../../assets/icons/app_icon_256.png ]; then
310+
cp ../../../../../assets/icons/app_icon_256.png fuego_wallet.png
311+
else
312+
echo "Error: Icon file not found!"
313+
exit 1
314+
fi
315+
fi
316+
# Copy desktop file
317+
if [ -f ../../../../../linux/xfg-wallet.desktop ]; then
318+
cp ../../../../../linux/xfg-wallet.desktop XF₲-Wallet.desktop
319+
else
320+
# Create desktop file for AppImage
321+
cat > XF₲-Wallet.desktop << 'EOF'
322+
[Desktop Entry]
323+
Version=1.0
324+
Type=Application
325+
Name=XF₲ Wallet
326+
GenericName=Cryptocurrency Wallet
327+
Comment=Privacy-focused cryptocurrency wallet for XF₲
328+
Exec=fuego_wallet
329+
Icon=fuego_wallet
330+
Terminal=false
331+
Categories=Finance;Network;
332+
Keywords=cryptocurrency;wallet;privacy;fuego;xfg;
333+
StartupWMClass=fuego_wallet
334+
StartupNotify=true
335+
EOF
336+
fi
306337
# Create AppImage (using extraction to avoid FUSE)
307338
./appimagetool-x86_64.AppImage --appimage-extract
308-
# Create desktop file for AppImage
309-
cat > XF₲-Wallet.desktop << 'EOF'
310-
[Desktop Entry]
311-
Type=Application
312-
Name=XF₲ Wallet
313-
Comment=Privacy-focused cryptocurrency wallet
314-
Exec=fuego_wallet
315-
Icon=fuego_wallet
316-
Categories=Finance; EOF
317339
./squashfs-root/AppRun . XF₲-Wallet-Linux-GLIBC-2.35.AppImage
318340
# Clean up
319341
rm -f appimagetool-x86_64.AppImage
@@ -334,7 +356,6 @@ jobs:
334356
files: build/linux/x64/release/bundle/XF₲-Wallet-Linux-GLIBC-2.35.AppImage
335357
name: XF₲-Wallet-Linux-GLIBC-2.35.AppImage
336358

337-
338359
build-linux-latest:
339360
name: Build XF₲ Wallet (Linux - Latest)
340361
runs-on: ubuntu-latest
@@ -346,8 +367,8 @@ jobs:
346367
- name: Set up Flutter
347368
uses: subosito/flutter-action@v2
348369
with:
349-
flutter-version: '3.24.0'
350-
channel: 'stable'
370+
flutter-version: "3.24.0"
371+
channel: "stable"
351372

352373
- name: Download xfg-stark-cli
353374
run: |

0 commit comments

Comments
 (0)