Skip to content

Commit a15f4b4

Browse files
Refactor Windows build workflow for clarity and efficiency
1 parent 0a54411 commit a15f4b4

File tree

1 file changed

+10
-33
lines changed

1 file changed

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

33
on:
44
push:
5-
branches: [ main ]
6-
workflow_dispatch:
5+
branches: [ windows-build ]
6+
pull_request:
77

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

1212
steps:
13-
# 1. Checkout repo
14-
- name: Checkout repository
13+
- name: Check out repository
1514
uses: actions/checkout@v3
1615

17-
# 2. Setup Python
18-
- name: Setup Python
16+
- name: Set up Python
1917
uses: actions/setup-python@v4
2018
with:
2119
python-version: '3.11'
2220

23-
# 3. Install dependencies
2421
- name: Install dependencies
2522
run: |
2623
python -m pip install --upgrade pip
2724
pip install pyinstaller
2825
29-
# 4. Build EXE
3026
- name: Build EXE
3127
run: |
3228
pyinstaller --onefile main.py
29+
# Als je een icoon wilt, kan je hier toevoegen:
30+
# pyinstaller --onefile --icon=icon.ico main.py
3331
34-
# 5. Setup Git
35-
- name: Setup Git
36-
run: |
37-
git config --global user.name "github-actions"
38-
git config --global user.email "github-actions@users.noreply.github.com"
39-
40-
# 6. Commit EXE to new branch using PAT
41-
- name: Commit EXE to new branch
42-
env:
43-
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
44-
run: |
45-
git checkout -b windows-build
46-
mkdir -p exe
47-
mv dist/main.exe exe/
48-
git add exe/main.exe
49-
git commit -m "Add Windows EXE build"
50-
# force remote to use PAT
51-
git remote set-url origin https://jonasvanleeuwen19:${PAT_TOKEN}@github.com/jonasvanleeuwen19/youtube-player.git
52-
git push --set-upstream origin windows-build
53-
54-
# 7. Upload artifact
55-
- name: Upload artifact
32+
- name: Upload EXE als artifact
5633
uses: actions/upload-artifact@v4
5734
with:
58-
name: windows-exe
59-
path: exe/main.exe
35+
name: windows-build
36+
path: dist/main.exe

0 commit comments

Comments
 (0)