Skip to content

Commit 852f7dc

Browse files
Enhance Windows build workflow with Git commit
1 parent 40da719 commit 852f7dc

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed
Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: Build Windows EXE
1+
name: Build Windows EXE and push to new branch
22

33
on:
44
push:
55
branches: [ main ]
6-
pull_request:
6+
workflow_dispatch: # hiermee kun je de workflow handmatig starten
77

88
jobs:
99
build-windows:
1010
runs-on: windows-latest
1111

1212
steps:
13-
- name: Check out repo
13+
- name: Checkout repo
1414
uses: actions/checkout@v3
1515

16-
- name: Set up Python
16+
- name: Setup Python
1717
uses: actions/setup-python@v4
1818
with:
1919
python-version: '3.11'
@@ -26,9 +26,24 @@ jobs:
2626
- name: Build EXE
2727
run: |
2828
pyinstaller --onefile your_script.py
29+
# je exe komt in dist/your_script.exe
30+
31+
- name: Setup Git
32+
run: |
33+
git config --global user.name "github-actions"
34+
git config --global user.email "[email protected]"
35+
36+
- name: Commit EXE to new branch
37+
run: |
38+
git checkout -b windows-build
39+
mkdir -p exe
40+
mv dist/your_script.exe exe/
41+
git add exe/your_script.exe
42+
git commit -m "Add Windows EXE build"
43+
git push --set-upstream origin windows-build
2944
3045
- name: Upload artifact
31-
uses: actions/upload-artifact@v3
46+
uses: actions/upload-artifact@v4
3247
with:
33-
name: my-windows-exe
34-
path: dist/your_script.exe
48+
name: windows-exe
49+
path: exe/your_script.exe

0 commit comments

Comments
 (0)