-
Notifications
You must be signed in to change notification settings - Fork 89
116 lines (101 loc) · 2.71 KB
/
Copy pathbuild.yml
File metadata and controls
116 lines (101 loc) · 2.71 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
name: Build Browser and Desktop Apps
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
NODE_VERSION: '20'
jobs:
detect-changes:
name: Detect Changed Paths
runs-on: ubuntu-latest
outputs:
browser: ${{ steps.filter.outputs.browser }}
desktop: ${{ steps.filter.outputs.desktop }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Filter changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
browser:
- 'browser/**'
desktop:
- 'desktop/**'
build-browser:
name: Build Browser Bundle
needs: detect-changes
runs-on: ubuntu-latest
if: needs.detect-changes.outputs.browser == 'true'
defaults:
run:
working-directory: browser
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm install
- name: Build static site
run: npm run build
- name: Upload browser dist
uses: actions/upload-artifact@v4
with:
name: browser-dist
path: browser/dist
if-no-files-found: error
build-desktop:
name: Build Desktop Apps
needs: detect-changes
runs-on: ${{ matrix.os }}
if: needs.detect-changes.outputs.desktop == 'true'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: linux
build_script: build:linux
artifact_name: desktop-linux
- os: windows-latest
target: windows
build_script: build:win
artifact_name: desktop-windows
defaults:
run:
working-directory: desktop
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Linux build dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 libudev-dev rpm
- name: Install dependencies
run: npm install
- name: Build desktop package
run: npm run ${{ matrix.build_script }}
- name: Upload desktop artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: desktop/dist
if-no-files-found: error