Skip to content

Commit 9f14735

Browse files
Add automated cross-platform release workflow (Windows, macOS, Linux)
1 parent 7463175 commit 9f14735

3 files changed

Lines changed: 188 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build for ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
include:
19+
- os: ubuntu-latest
20+
artifact_name: RadarSim_Linux
21+
asset_name: RadarSim_v${{ github.ref_name }}_Linux.tar.gz
22+
- os: windows-latest
23+
artifact_name: RadarSim_Windows
24+
asset_name: RadarSim_v${{ github.ref_name }}_Windows.zip
25+
- os: macos-latest
26+
artifact_name: RadarSim_macOS
27+
asset_name: RadarSim_v${{ github.ref_name }}_macOS.zip
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.10'
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install pyinstaller
41+
pip install -r requirements.txt
42+
43+
- name: Build with PyInstaller
44+
run: pyinstaller RadarSim.spec
45+
46+
- name: Package Windows
47+
if: matrix.os == 'windows-latest'
48+
run: |
49+
cd dist
50+
powershell Compress-Archive -Path RadarSim/* -DestinationPath ../${{ matrix.asset_name }}
51+
52+
- name: Package Linux
53+
if: matrix.os == 'ubuntu-latest'
54+
run: |
55+
cd dist
56+
tar -czvf ../${{ matrix.asset_name }} RadarSim/
57+
58+
- name: Package macOS
59+
if: matrix.os == 'macos-latest'
60+
run: |
61+
cd dist
62+
zip -r ../${{ matrix.asset_name }} RadarSim/
63+
64+
- name: Upload Artifact
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: ${{ matrix.artifact_name }}
68+
path: ${{ matrix.asset_name }}
69+
70+
release:
71+
name: Create Release
72+
needs: build
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Download Artifacts
76+
uses: actions/download-artifact@v4
77+
with:
78+
merge-multiple: true
79+
80+
- name: Create GitHub Release
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
files: |
84+
RadarSim_v*_Linux.tar.gz
85+
RadarSim_v*_Windows.zip
86+
RadarSim_v*_macOS.zip
87+
name: RadarSim ${{ github.ref_name }}
88+
draft: false
89+
prerelease: false
90+
body: |
91+
## 🚀 RadarSim ${{ github.ref_name }} Official Release
92+
93+
Automated cross-platform build for Windows, Linux, and macOS.
94+
95+
### 📦 Installation:
96+
1. Download the archive for your operating system.
97+
2. Extract the contents.
98+
3. Run the `RadarSim` executable.
99+
100+
---
101+
*Scientifically accurate radar simulation engine.*
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ wheels/
2727
# PyInstaller
2828
*.manifest
2929
*.spec
30+
!RadarSim.spec
3031

3132
# Installer logs
3233
pip-log.txt

RadarSim.spec

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
import sys
4+
import os
5+
from PyInstaller.utils.hooks import collect_data_files
6+
7+
block_cipher = None
8+
9+
# Collect data files for critical dependencies
10+
datas = []
11+
# Manual data collection to avoid overcomplicating the CI environment
12+
if os.path.exists('src'):
13+
datas += collect_data_files('src')
14+
if os.path.exists('scenarios'):
15+
datas.append(('scenarios', 'scenarios'))
16+
17+
a = Analysis(
18+
['src/main.py'],
19+
pathex=[],
20+
binaries=[],
21+
datas=datas,
22+
hiddenimports=[
23+
'PyQt6.QtCore',
24+
'PyQt6.QtGui',
25+
'PyQt6.QtWidgets',
26+
'pyqtgraph',
27+
'numpy',
28+
'scipy',
29+
'pandas',
30+
'yaml',
31+
'matplotlib',
32+
'numba',
33+
'h5py',
34+
'psutil',
35+
'tqdm',
36+
'joblib',
37+
'sklearn',
38+
'sklearn.utils._cython_blas',
39+
'sklearn.utils._typedefs',
40+
'sklearn.neighbors.typedefs',
41+
'sklearn.neighbors.quad_tree',
42+
'sklearn.tree._utils',
43+
],
44+
hookspath=[],
45+
hooksconfig={},
46+
runtime_hooks=[],
47+
excludes=[],
48+
win_no_prefer_redirects=False,
49+
win_private_assemblies=False,
50+
cipher=block_cipher,
51+
noarchive=False,
52+
)
53+
54+
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
55+
56+
exe = EXE(
57+
pyz,
58+
a.scripts,
59+
[],
60+
exclude_binaries=True,
61+
name='RadarSim',
62+
debug=False,
63+
bootloader_ignore_signals=False,
64+
strip=False,
65+
upx=True,
66+
console=False,
67+
disable_windowed_traceback=False,
68+
argv_emulation=False,
69+
target_arch=None,
70+
codesign_identity=None,
71+
entitlements_file=None,
72+
icon=['resources/icon.ico'] if os.path.exists('resources/icon.ico') else None,
73+
)
74+
75+
coll = COLLECT(
76+
exe,
77+
a.binaries,
78+
a.zipfiles,
79+
a.datas,
80+
strip=False,
81+
upx=True,
82+
upx_exclude=[],
83+
name='RadarSim',
84+
)

0 commit comments

Comments
 (0)