-
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (63 loc) · 2.34 KB
/
Copy pathbuild.yml
File metadata and controls
76 lines (63 loc) · 2.34 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
name: Build and Release
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
types: [closed]
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
output_name: SourceBox.exe
artifact_name: SourceBox-Windows
- os: ubuntu-latest
output_name: SourceBox
artifact_name: SourceBox-Linux
steps:
- 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 --upgrade "pyinstaller>=6.0.0"
pip install -r requirements.txt
pip install pillow
- name: Build executable (Windows)
if: matrix.os == 'windows-latest'
run: |
pyinstaller --onefile --windowed --name SourceBox --icon=assets/images/sourcebox.png --add-data "assets;assets" --exclude-module pkg_resources --exclude-module setuptools --exclude-module numpy --exclude-module pandas --exclude-module matplotlib --noupx --clean Sourcebox.py
- name: Build executable (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
pyinstaller --onefile --windowed --name SourceBox --icon=assets/images/sourcebox.png --add-data "assets:assets" --exclude-module pkg_resources --exclude-module setuptools --exclude-module numpy --exclude-module pandas --exclude-module matplotlib --hidden-import=OpenGL.platform.glx --hidden-import=OpenGL.arrays.vbo --collect-all OpenGL --noupx --clean Sourcebox.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist/${{ matrix.output_name }}
- name: Upload to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: dist/${{ matrix.output_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}