-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (95 loc) · 3 KB
/
Copy pathbuild.yml
File metadata and controls
109 lines (95 loc) · 3 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
name: Build Grid CLI
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
include:
- os: windows-latest
artifact_name: GridSetup.exe
asset_name: GridSetup.exe
- os: macos-latest
artifact_name: grid
asset_name: Grid-macOS
- os: ubuntu-latest
artifact_name: grid
asset_name: Grid-Linux.AppImage
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dependencies
run: |
pip install -r requirements.txt
pip install pyinstaller
- name: Build with PyInstaller (Windows)
if: runner.os == 'Windows'
run: |
pyinstaller --noconfirm --onefile --console --name "grid" --icon "grid/assets/icon.ico" grid/main.py
- name: Compile Windows Setup (Inno Setup)
if: runner.os == 'Windows'
uses: isalvia/innosetup-compiler-action@v1
with:
filepath: setup.iss
- name: Rename Setup for Consistency (Windows)
if: runner.os == 'Windows'
run: |
mv Output/GridSetup.exe dist/GridSetup.exe
- name: Build with PyInstaller (Mac/Linux)
if: runner.os != 'Windows'
run: |
pyinstaller --noconfirm --onefile --console --name "grid" grid/main.py
- name: Create DMG (macOS)
if: runner.os == 'macOS'
run: |
# Quick DMG creation (requires create-dmg)
brew install create-dmg
mkdir -p dist/Grid-Installer
cp dist/grid dist/Grid-Installer/
create-dmg \
--volname "Grid CLI Installer" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "grid" 200 190 \
--hide-extension "grid" \
--app-drop-link 600 185 \
"dist/Grid-macOS.dmg" \
"dist/Grid-Installer/"
- name: Create AppImage (Linux)
if: runner.os == 'Linux'
run: |
# Simple AppImage wrap (using linuxdeploy or just tagging the binary)
# For CLI, standard binary is often enough, but let's just rename
mv dist/grid dist/Grid-Linux.AppImage
chmod +x dist/Grid-Linux.AppImage
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.asset_name }}*
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
GridSetup.exe/GridSetup.exe
Grid-macOS/Grid-macOS.dmg
Grid-Linux.AppImage/Grid-Linux.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}