Skip to content

Commit 93fede6

Browse files
authored
FIX: Fix linux workflow (#111)
1 parent d5b386b commit 93fede6

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.github/workflows/build.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: Build and Package
22

33
on:
44
push:
5-
branches:
6-
- v2
5+
branches: [ v2 ]
6+
pull_request:
7+
branches: [ v2 ]
78

89
jobs:
910
build:

Makefile

+16-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ifeq ($(OS),Windows_NT)
66
PYTHON = ".venv/Scripts/python.exe"
77
CP = xcopy /E /I /Y
8-
EXTRA_PYINSTALLER_FLAGS = ""
8+
EXTRA_PYINSTALLER_FLAGS =
99

1010
define find-functions
1111
@powershell -Command "$$matches = Select-String -Path $(MAKEFILE_LIST) -Pattern '##'; foreach ($$match in $$matches) { if ($$match.Line -notmatch 'powershell|Select-String') { $$line = $$match.Line; $$line -replace '.*##', '' } }"
@@ -50,6 +50,19 @@ install: .venv/pyvenv.cfg frontend/node_modules
5050

5151
## build - Build whole project to frontend/dist.
5252
.PHONY: build
53+
ifeq ($(OS), Windows_NT)
54+
build: .venv/pyvenv.cfg frontend/node_modules
55+
$(PYTHON) -m PyInstaller -n tf2-gptcb --noconfirm --icon icon.ico -w $(EXTRA_PYINSTALLER_FLAGS) main.py
56+
$(CP) cfg dist\tf2-gptcb/cfg
57+
$(CP) icon.png dist\tf2-gptcb
58+
$(CP) commands.yaml dist\tf2-gptcb
59+
mkdir dist\tf2-gptcb/logs
60+
$(CP) prompts dist\tf2-gptcb\prompts
61+
$(CP) schemas dist\tf2-gptcb\schemas
62+
63+
cd frontend
64+
npm run pack
65+
else
5366
build: .venv/pyvenv.cfg frontend/node_modules
5467
$(PYTHON) -m PyInstaller -n tf2-gptcb --noconfirm --icon icon.ico -w $(EXTRA_PYINSTALLER_FLAGS) main.py
5568
$(CP) cfg dist/tf2-gptcb/cfg
@@ -61,6 +74,8 @@ build: .venv/pyvenv.cfg frontend/node_modules
6174

6275
cd frontend
6376
npm run pack
77+
endif
78+
6479

6580
## lint - Runs linters on src.
6681
.PHONY: lint

frontend/package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"electron:dev": "wait-on tcp:3000 && cross-env VITE_ENVIRONMENT=development electron .",
2323
"electron:demo": "wait-on tcp:3000 && cross-env VITE_ENVIRONMENT=demo electron .",
2424
"build": "cross-env VITE_APP_ELECTRON=true vite build",
25-
"pack": "npm run build && electron-builder",
25+
"pack": "npm run build && electron-builder --publish never",
2626
"test": "vite test",
2727
"eject": "vite eject"
2828
},
@@ -93,6 +93,11 @@
9393
"zip"
9494
]
9595
},
96+
"linux": {
97+
"target": [
98+
"zip"
99+
]
100+
},
96101
"extends": null
97102
},
98103
"eslintConfig": {

0 commit comments

Comments
 (0)