Skip to content

Commit 566c4df

Browse files
committed
Adding workflow to build a windows exe
1 parent 0dca0cb commit 566c4df

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Windows Executable on Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: windows-latest
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
cache: 'pip'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pyinstaller
24+
pip install -r requirements.txt
25+
26+
- name: Build executable with PyInstaller
27+
run: |
28+
pyinstaller --onefile --add-data "config.ini;." --name ed-joystick-helper main.py
29+
30+
- name: Zip the executable
31+
run: |
32+
cd dist
33+
Compress-Archive -Path ed-joystick-helper.exe -DestinationPath ed-joystick-helper-windows.zip
34+
35+
- name: Upload executable to release
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
files: |
39+
dist/ed-joystick-helper.exe
40+
dist/ed-joystick-helper-windows.zip
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)