Skip to content

Commit 13c7acd

Browse files
committed
2 parents b5cfa9e + ed86757 commit 13c7acd

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build LibreMonitor Executable
2+
on:
3+
push:
4+
branches: [ main ]
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: windows-latest
10+
steps:
11+
# Gets repo
12+
- name: Repo Checkout
13+
uses: actions/[email protected]
14+
15+
- name: Python Setup
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install Requirements
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pyinstaller
24+
pip install pythonnet
25+
26+
- name: Get Latest .DLL files
27+
id: get_release
28+
run: |
29+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/LibreHardwareMonitor/LibreHardwareMonitor/releases/latest"
30+
$asset = $response.assets | Where-Object { $_.name -like "*LibreHardwareMonitor*.zip" }
31+
"zip_url=$($asset.browser_download_url)" | Out-File -FilePath $env:GITHUB_ENV -Append
32+
- name: 📥 Download and extract DLLs
33+
run: |
34+
curl -L -o LibreHardwareMonitor.zip $env:zip_url
35+
Expand-Archive -Path LibreHardwareMonitor.zip -DestinationPath libre_cli
36+
37+
- name: 🛠️ Build with PyInstaller
38+
run: |
39+
python -m PyInstaller --onefile --name "LibreMonitor" `
40+
.\libre_cli\libre_hardware_monitor_reporter.py `
41+
--add-binary ".\libre_cli\LibreHardwareMonitorLib.dll;." `
42+
--add-binary ".\libre_cli\Aga.Controls.dll;." `
43+
--add-binary ".\libre_cli\HidSharp.dll;."
44+
- name: 🏷️ Set version tag
45+
run: |
46+
echo "VERSION=$(git rev-parse --short HEAD)" >> $env:GITHUB_ENV
47+
- name: 📤 Upload artifact
48+
uses: actions/[email protected]
49+
with:
50+
name: LibreMonitor
51+
path: dist/LibreMonitor.exe

0 commit comments

Comments
 (0)