-
Notifications
You must be signed in to change notification settings - Fork 7
126 lines (110 loc) · 3.27 KB
/
Copy pathbuild-desktop.yml
File metadata and controls
126 lines (110 loc) · 3.27 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
name: Build Desktop App
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., 1.0.0)'
required: true
default: '1.0.0'
jobs:
build-backend:
strategy:
matrix:
os: [macos-latest, macos-13, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build backend (macOS/Linux)
if: runner.os != 'Windows'
run: |
pyinstaller --clean --noconfirm noctune-backend.spec
ls -la dist/
- name: Build backend (Windows)
if: runner.os == 'Windows'
run: |
pyinstaller --clean --noconfirm noctune-backend.spec
dir dist\
- name: Upload backend artifact
uses: actions/upload-artifact@v4
with:
name: backend-${{ matrix.os }}
path: dist/noctune-backend*
build-electron:
needs: build-backend
strategy:
matrix:
include:
- os: macos-latest
platform: mac
arch: arm64
- os: macos-13
platform: mac
arch: x64
- os: windows-latest
platform: win
arch: x64
- os: ubuntu-latest
platform: linux
arch: x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Download backend artifact
uses: actions/download-artifact@v4
with:
name: backend-${{ matrix.os }}
path: dist/
- name: Make backend executable (Unix)
if: runner.os != 'Windows'
run: chmod +x dist/noctune-backend
- name: Install Electron dependencies
working-directory: electron
run: npm install
- name: Build Electron app
working-directory: electron
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build -- --${{ matrix.platform }} --${{ matrix.arch }}
- name: Upload Electron artifact
uses: actions/upload-artifact@v4
with:
name: noc-tune-${{ matrix.platform }}-${{ matrix.arch }}
path: |
electron/dist/*.dmg
electron/dist/*.exe
electron/dist/*.AppImage
electron/dist/*.deb
release:
needs: build-electron
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/**/*.dmg
artifacts/**/*.exe
artifacts/**/*.AppImage
artifacts/**/*.deb
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}