-
Notifications
You must be signed in to change notification settings - Fork 6
157 lines (140 loc) · 4.43 KB
/
build-desktop.yml
File metadata and controls
157 lines (140 loc) · 4.43 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Build Desktop Applications
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
inputs:
publish:
description: "Publish to GitHub Releases"
required: false
default: "false"
jobs:
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
- os: macos-latest
platform: mac
- os: windows-latest
platform: windows
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Fix app-builder permissions (Linux)
if: runner.os == 'Linux'
run: |
# Fix all app-builder binaries regardless of location
find node_modules -type f -name 'app-builder' -exec chmod +x {} \;
echo "Fixed permissions for app-builder binaries:"
find node_modules -type f -name 'app-builder' -exec ls -la {} \;
- name: Build main application
run: npm run build
- name: Build Electron app (Linux)
if: matrix.platform == 'linux'
run: npm run electron:build:linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Electron app (macOS)
if: matrix.platform == 'mac'
run: |
# Retry logic for macOS DMG creation (disk busy issues)
max_attempts=3
attempt=0
until [ $attempt -ge $max_attempts ]
do
attempt=$((attempt+1))
echo "Build attempt $attempt of $max_attempts"
if npm run electron:build:mac; then
echo "Build succeeded on attempt $attempt"
break
else
if [ $attempt -lt $max_attempts ]; then
echo "Build failed, waiting 10 seconds before retry..."
sleep 10
# Clean up any mounted disks
hdiutil detach /Volumes/LiaScript* 2>/dev/null || true
sleep 5
else
echo "Build failed after $max_attempts attempts"
exit 1
fi
fi
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# For code signing (optional):
# CSC_LINK: ${{ secrets.MAC_CERT }}
# CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Build Electron app (Windows)
if: matrix.platform == 'windows'
run: npm run electron:build:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# For code signing (optional):
# CSC_LINK: ${{ secrets.WIN_CERT }}
# CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_PASSWORD }}
- name: List build artifacts
run: ls -R release/
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-builds
path: |
release/*.exe
release/*.zip
release/*.dmg
release/*.AppImage
release/@liascript/*.deb
release/@liascript/*.rpm
release/@liascript/*.tar.gz
release/*.yml
retention-days: 30
- name: Upload to Release (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
release/*.exe
release/*.zip
release/*.dmg
release/*.AppImage
release/@liascript/*.deb
release/@liascript/*.rpm
release/@liascript/*.tar.gz
release/*.yml
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Summary job
build-summary:
name: Build Summary
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- name: Check build status
run: |
echo "Build completed!"
echo "Linux: ${{ needs.build.result }}"
echo "macOS: ${{ needs.build.result }}"
echo "Windows: ${{ needs.build.result }}"