-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (138 loc) · 5.08 KB
/
Copy pathbuild.yml
File metadata and controls
168 lines (138 loc) · 5.08 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
158
159
160
161
162
163
164
165
166
167
168
name: Build & Release
on:
push:
tags:
- 'v*'
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements-windows.txt
- name: Set version
run: |
$version = "${{ github.ref_name }}".TrimStart("v")
(Get-Content version.py) -replace '__version__ = ".*"', "__version__ = `"$version`"" | Set-Content version.py
- name: Build exe
run: pyinstaller MusicPresence.spec --distpath dist --workpath build
- name: Build installer (Inno Setup)
env:
APP_VERSION: ${{ github.ref_name }}
run: |
mkdir installer\installer_output
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer\MusicPresence.iss
- name: Zip portable
run: Compress-Archive -Path dist\MusicPresence\* -DestinationPath dist\MusicPresence-portable.zip
- name: Upload portable
uses: actions/upload-artifact@v4
with:
name: MusicPresence-windows-portable
path: dist/MusicPresence-portable.zip
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: MusicPresence-windows-setup
path: installer/installer_output/MusicPresence-Setup-*.exe
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libdbus-1-dev \
libglib2.0-dev \
libcairo2-dev \
libgirepository-2.0-dev \
gir1.2-appindicator3-0.1 \
pkg-config \
fuse \
libfuse2
- name: Install dependencies
run: pip install -r requirements-linux.txt
- name: Set version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" version.py
- name: Build binary
run: pyinstaller MusicPresence.spec --distpath dist --workpath build
- name: Build AppImage
env:
APP_VERSION: ${{ github.ref_name }}
run: |
# Téléchargement appimagetool
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O appimagetool
chmod +x appimagetool
# Structure AppDir
mkdir -p AppDir/usr/bin
cp -r dist/MusicPresence AppDir/usr/bin/MusicPresence
chmod +x AppDir/usr/bin/MusicPresence/MusicPresence
# Icône
cp assets/icon.png AppDir/MusicPresence.png
# .desktop
cp installer/MusicPresence.desktop AppDir/MusicPresence.desktop
# AppRun
cat > AppDir/AppRun << 'APPRUN'
#!/bin/bash
SELF=$(readlink -f "$0")
HERE="${SELF%/*}"
exec "$HERE/usr/bin/MusicPresence/MusicPresence" "$@"
APPRUN
chmod +x AppDir/AppRun
# Build AppImage
ARCH=x86_64 ./appimagetool AppDir MusicPresence-$APP_VERSION-x86_64.AppImage
- name: Tar portable
run: tar -czf dist/MusicPresence-linux.tar.gz -C dist MusicPresence
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: MusicPresence-linux-binary
path: dist/MusicPresence-linux.tar.gz
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: MusicPresence-linux-appimage
path: MusicPresence-*.AppImage
release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: MusicLocal Discord Presence ${{ github.ref_name }}
body: |
## Installation
### Windows
| Fichier | Description |
|---|---|
| `MusicPresence-Setup-*.exe` | Installeur (recommandé) |
| `MusicPresence.exe` | Portable, sans installation |
### Linux
| Fichier | Description |
|---|---|
| `MusicPresence-*-x86_64.AppImage` | AppImage universel |
| `MusicPresence-linux.tar.gz` | Archive portable |
> Placez votre fichier `.env` dans le même dossier que l'exécutable.
files: |
artifacts/MusicPresence-windows-setup/MusicPresence-Setup-*.exe
artifacts/MusicPresence-windows-portable/MusicPresence-portable.zip
artifacts/MusicPresence-linux-appimage/MusicPresence-*.AppImage
artifacts/MusicPresence-linux-binary/MusicPresence-linux.tar.gz