Skip to content

Commit 2761567

Browse files
Update Windows build workflow for EXE creation
1 parent c0e6f47 commit 2761567

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/build-windows.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,53 @@ name: Build Windows EXE and push to new branch
33
on:
44
push:
55
branches: [ main ]
6-
workflow_dispatch:
6+
workflow_dispatch:
77

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

1212
steps:
13-
- name: Checkout repo
13+
# 1. Checkout repo
14+
- name: Checkout repository
1415
uses: actions/checkout@v3
1516

17+
# 2. Setup Python
1618
- name: Setup Python
1719
uses: actions/setup-python@v4
1820
with:
1921
python-version: '3.11'
2022

23+
# 3. Install dependencies
2124
- name: Install dependencies
2225
run: |
2326
python -m pip install --upgrade pip
2427
pip install pyinstaller
2528
29+
# 4. Build EXE
2630
- name: Build EXE
2731
run: |
2832
pyinstaller --onefile main.py
2933
34+
# 5. Setup Git
3035
- name: Setup Git
3136
run: |
3237
git config --global user.name "github-actions"
3338
git config --global user.email "github-actions@users.noreply.github.com"
3439
40+
# 6. Commit EXE to new branch using PAT
3541
- name: Commit EXE to new branch
42+
env:
43+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
3644
run: |
3745
git checkout -b windows-build
3846
mkdir -p exe
3947
mv dist/main.exe exe/
4048
git add exe/main.exe
4149
git commit -m "Add Windows EXE build"
42-
git push --set-upstream origin windows-build
50+
git push --set-upstream https://jonasvanleeuwen19:${PAT_TOKEN}@github.com/jonasvanleeuwen19/youtube-player.git windows-build
4351
52+
# 7. Upload artifact
4453
- name: Upload artifact
4554
uses: actions/upload-artifact@v4
4655
with:

0 commit comments

Comments
 (0)