-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (52 loc) · 1.41 KB
/
Copy pathbuild-desktop.yml
File metadata and controls
57 lines (52 loc) · 1.41 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
name: Build Desktop
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
ext: .exe
- os: ubuntu-latest
ext: .AppImage
- os: macos-latest
ext: .dmg
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install and build web app
run: |
npm install
npm run build
env:
VITE_BASE: "./"
- name: Fix base path for Electron
run: |
node -e "
const fs = require('fs');
let html = fs.readFileSync('dist/index.html', 'utf8');
html = html.replace(/\/todo-app\//g, './');
fs.writeFileSync('dist/index.html', html);
"
shell: bash
- name: Install Electron deps
run: npm install --save-dev electron electron-builder
- name: Build desktop app
run: npx electron-builder --config electron-builder.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: |
release/*.exe
release/*.AppImage
release/*.dmg
fail_on_unmatched_files: false