-
Notifications
You must be signed in to change notification settings - Fork 6
140 lines (122 loc) · 3.73 KB
/
Copy pathbuild-desktop.yml
File metadata and controls
140 lines (122 loc) · 3.73 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
name: Build Desktop Applications
on:
push:
tags:
- 'v*.*.*'
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: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build main application
run: npm run build
- name: Install icon builder (Ubuntu/macOS)
if: runner.os != 'Windows'
run: npm install -g electron-icon-builder
- name: Install icon builder (Windows)
if: runner.os == 'Windows'
run: npm install -g electron-icon-builder
shell: powershell
- name: Generate icons
run: |
cd electron/build
electron-icon-builder --input=../../LiaScript/resources/icon.png --output=.
shell: bash
- 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: npm run electron:build:mac
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/*.deb
release/*.rpm
release/*.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/*.deb
release/*.rpm
release/*.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 }}"