-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (129 loc) · 5.01 KB
/
build_executables.yml
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
133
134
135
136
137
138
139
140
141
name: Build Executables
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
branches: [2024-data-collection-updates]
pull_request:
branches: [2024-data-collection-updates]
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
# if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
activate-environment: kivy20
python-version: "3.10"
channels: conda-forge
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive # Initializes and updates submodules
- name: create env
shell: bash -l {0}
run: conda install -y kivy=2.3 pyinstaller=4.10 requests glfw
- name: pip installs
shell: bash -l {0}
run: pip install kivy-deps.sdl2 kivy-deps.glew pyo
- name: install smile
shell: bash -l {0}
run: pip install -e smile
- name: create files
shell: bash -l {0}
run: echo $SI > serverinfo.txt && echo $ULCRT > cert.pem
- name: package cogmood
shell: bash -l {0}
run: |
cd package
export KIVY_GL_BACKEND=angle_sdl2
python -m PyInstaller cogmood_windows.spec
- name: save exe
uses: actions/upload-artifact@v3
with:
name: SUPREME
path: package/dist/SUPREME.exe
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.10" # Specify your Python version
# cache: 'pip' # caching pip dependencies
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
#
# - name: Set up Mesa3D OpenGL DLL
# run: |
# curl -L -o mesa3d-22.1.5-release-mingw.7z https://github.com/pal1000/mesa-dist-win/releases/download/22.1.5/mesa3d-22.1.5-release-mingw.7z
# 7z x mesa3d-22.1.5-release-mingw.7z -o$HOME/mesa3d
#
# - name: Add Mesa3D to Path
# run: |
# export PATH=$HOME/mesa3d/x86/:$PATH
#
# - name: Build executable with PyInstaller
# run: |
# cd package
# pyinstaller --noconfirm --upx-dir upx/windows_upx.exe cogmood_windows.spec
#
# - name: Upload Windows executable
# uses: actions/upload-artifact@v4
# with:
# name: SUPREME
# path: dist/SUPREME.exe # Path to your Windows executable
build-macos:
runs-on: macos-14
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
# if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive # Initializes and updates submodules
- name: Install Homebrew dependencies
run: |
brew update
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # Specify your Python version
- name: Check if Python is a fat binary
run: |
if lipo -info $(which python3) | grep -q "Architectures in the fat file"; then
lipo -info $(which python3)
echo "Python is a fat binary."
export PATH=/Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin:$PATH
else
echo "Python is NOT a fat binary."
exit 1 # Optional: Exit with error if you require a fat binary
fi
- name: Install dependencies
run: |
export PATH=/Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin:$PATH
python3 -m pip install --platform macosx_10_9_universal2 --upgrade pip
python3 -m pip install --platform macosx_10_9_universal2 -r requirements.txt
- name: Build executable with PyInstaller
run: |
cd package
python3 -m PyInstaller --noconfirm cogmood_mac.spec
- name: Upload macOS executable
uses: actions/upload-artifact@v4
with:
name: SUPREME
path: package/dist/SUPREME