-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (88 loc) · 2.94 KB
/
Copy pathbuild-desktop.yml
File metadata and controls
105 lines (88 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Build Desktop Apps
on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to attach builds to (optional)"
required: false
type: string
permissions:
contents: write
jobs:
build-desktop:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
targets: "--linux deb AppImage"
- os: windows-latest
platform: win
targets: "--win nsis portable"
- os: macos-latest
platform: mac
targets: "--mac dmg"
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Export web build
run: bunx expo export --platform web
- name: Install Electron and electron-builder
run: bun add -d electron@^33.0.0 electron-builder@^25.0.0
- name: Build desktop app
shell: bash
run: |
# electron-builder reads "main" from package.json
# Override it to point to Electron entry instead of expo-router
node -e "
const pkg = require('./package.json');
pkg.main = 'electron/main.js';
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
"
bunx electron-builder ${{ matrix.targets }} --config electron-builder.yml
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Collect build outputs
shell: bash
run: |
VERSION="${GITHUB_REF_NAME:-${{ github.event.inputs.release_tag || 'dev' }}}"
mkdir -p desktop-output
for ext in dmg exe AppImage deb zip; do
find electron-dist -maxdepth 1 -name "*.${ext}" -exec cp {} desktop-output/ \; 2>/dev/null || true
done
echo "=== Desktop builds ==="
ls -lh desktop-output/ 2>/dev/null || echo "No files"
- name: Upload as artifact
uses: actions/upload-artifact@v4
with:
name: FAIRWallet-${{ matrix.platform }}
path: desktop-output/*
retention-days: 90
if-no-files-found: warn
- name: Attach to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: desktop-output/*
- name: Attach to Release (manual)
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.release_tag }}
files: desktop-output/*