-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (107 loc) · 3.92 KB
/
release.yml
File metadata and controls
132 lines (107 loc) · 3.92 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
name: Build and Release
on:
push:
tags:
- 'v*' # Triggers on version tags like v1.0.0
workflow_dispatch: # Allows manual triggering
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller pillow
- name: Generate app icon
run: python src/generate_icon.py
- name: Build Windows executable
run: |
pyinstaller --onefile --windowed --name OrbitalSimulator-${{ github.ref_name }}-windows --icon=assets/icon.ico --add-data "assets;assets" src/main.py
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: windows-build
path: dist/*.exe
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller pillow
- name: Generate app icon
run: python src/generate_icon.py
- name: Build macOS application
run: |
pyinstaller --onefile --windowed --name OrbitalSimulator-${{ github.ref_name }}-macos --icon=assets/icon.png --add-data "assets:assets" src/main.py
- name: Create DMG (optional)
run: |
mkdir -p dist/dmg
cp -r dist/OrbitalSimulator-*.app dist/dmg/
# You can add create-dmg here for a nicer installer
- name: Compress macOS app
run: |
cd dist
zip -r OrbitalSimulator-${{ github.ref_name }}-macos.zip *.app
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: macos-build
path: dist/*.zip
create-release:
needs: [build-windows, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: windows-build
path: dist/
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: macos-build
path: dist/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true
body: |
## 🚀 Orbital Simulation - Release ${{ github.ref_name }}
### 📦 Downloads
- **Windows**: Download the `.exe` file
- **macOS**: Download the `.zip` file, extract, and run
### 📝 Installation Instructions
**Windows:**
1. Download `OrbitalSimulator-${{ github.ref_name }}-windows.exe`
2. Run the executable (you may need to allow it through Windows Defender)
**macOS:**
1. Download `OrbitalSimulator-${{ github.ref_name }}-macos.zip`
2. Extract the archive
3. Right-click the app and select "Open" (first time only)
**Linux/Source:**
See README.md for installation from source
### ⚠️ Known Issues
- Windows Defender may flag the .exe (false positive) - click "More info" → "Run anyway"
- macOS Gatekeeper: Right-click → Open on first launch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}