@@ -26,22 +26,48 @@ jobs:
2626 pip install pyinstaller
2727 pip install -r requirements.txt
2828
29+ - name : Debug environment
30+ run : |
31+ Write-Host "Current directory: $(Get-Location)"
32+ Write-Host "Files in current directory:"
33+ Get-ChildItem
34+ Write-Host "Python version:"
35+ python --version
36+
2937 - name : Build with PyInstaller
3038 run : |
31- pyinstaller --clean blackjack_game.spec
39+ Write-Host "Building with PyInstaller..."
40+ pyinstaller --clean --noconfirm --log-level=DEBUG blackjack_game.spec
41+ Write-Host "Build completed. Checking dist folder:"
42+ if (Test-Path "dist") {
43+ Get-ChildItem dist/
44+ if (Test-Path "dist/BlackjackGame") {
45+ Write-Host "BlackjackGame folder contents:"
46+ Get-ChildItem dist/BlackjackGame/ | Select-Object -First 10
47+ Write-Host "Checking for custom files:"
48+ Get-ChildItem "dist/BlackjackGame/_internal" | Where-Object {$_.Name -like "*WezTerm*" -or $_.Name -like "*tcss*" -or $_.Name -like "*blackjack*"}
49+ } else {
50+ Write-Host "ERROR: BlackjackGame folder not found"
51+ exit 1
52+ }
53+ } else {
54+ Write-Host "ERROR: dist folder not created"
55+ exit 1
56+ }
3257
3358 - name : Create release package
3459 run : |
35- # Create a run script for users
60+ if (-not (Test-Path "dist/BlackjackGame/BlackjackGame.exe")) {
61+ Write-Host "ERROR: BlackjackGame.exe not found!"
62+ exit 1
63+ }
3664 echo '@echo off' > dist/BlackjackGame/run_game.bat
3765 echo 'title Blackjack Game' >> dist/BlackjackGame/run_game.bat
3866 echo 'echo Starting Blackjack Game...' >> dist/BlackjackGame/run_game.bat
3967 echo 'BlackjackGame.exe' >> dist/BlackjackGame/run_game.bat
4068 echo 'echo.' >> dist/BlackjackGame/run_game.bat
4169 echo 'echo Game ended. Press any key to close...' >> dist/BlackjackGame/run_game.bat
4270 echo 'pause >nul' >> dist/BlackjackGame/run_game.bat
43-
44- # Create instructions file
4571 echo 'Blackjack Game - Standalone Version' > dist/BlackjackGame/INSTRUCTIONS.txt
4672 echo '====================================' >> dist/BlackjackGame/INSTRUCTIONS.txt
4773 echo '' >> dist/BlackjackGame/INSTRUCTIONS.txt
@@ -52,19 +78,21 @@ jobs:
5278 echo 'No additional installation required.' >> dist/BlackjackGame/INSTRUCTIONS.txt
5379 echo '' >> dist/BlackjackGame/INSTRUCTIONS.txt
5480 echo 'Enjoy the game!' >> dist/BlackjackGame/INSTRUCTIONS.txt
55-
56- # Copy README if it exists
5781 if (Test-Path README.md) { Copy-Item README.md dist/BlackjackGame/ }
5882
5983 - name : Create ZIP archive
6084 run : |
61- Compress-Archive -Path "dist/BlackjackGame/*" -DestinationPath "BlackjackGame-Windows-${{ github.event.release.tag_name }}.zip"
85+ Write-Host "Creating ZIP archive..."
86+ Compress-Archive -Path "dist/BlackjackGame/*" -DestinationPath "BlackjackGame-Windows-${{ github.event.release.tag_name }}.zip" -Force
87+ $size = (Get-Item "BlackjackGame-Windows-${{ github.event.release.tag_name }}.zip").Length / 1MB
88+ Write-Host "ZIP created. Size: $([math]::Round($size, 2)) MB"
6289
6390 - name : Upload release asset
6491 env :
6592 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6693 run : |
67- gh release upload ${{ github.event.release.tag_name }} "BlackjackGame-Windows-${{ github.event.release.tag_name }}.zip"
94+ Write-Host "Uploading release asset..."
95+ gh release upload ${{ github.event.release.tag_name }} "BlackjackGame-Windows-${{ github.event.release.tag_name }}.zip" --clobber
6896
6997 build-linux :
7098 runs-on : ubuntu-latest
@@ -86,11 +114,25 @@ jobs:
86114
87115 - name : Build with PyInstaller
88116 run : |
89- pyinstaller --clean blackjack_game.spec
117+ echo "Building with PyInstaller..."
118+ pyinstaller --clean --noconfirm --log-level=DEBUG blackjack_game.spec
119+ echo "Build completed. Checking dist folder:"
120+ ls -la dist/
121+ if [ -d "dist/BlackjackGame" ]; then
122+ echo "BlackjackGame folder contents:"
123+ ls -la dist/BlackjackGame/
124+ else
125+ echo "ERROR: BlackjackGame folder not found in dist/"
126+ exit 1
127+ fi
90128
91129 - name : Create release package
92130 run : |
93- # Create a run script for users
131+ if [ ! -f "dist/BlackjackGame/BlackjackGame" ]; then
132+ echo "ERROR: BlackjackGame executable not found!"
133+ exit 1
134+ fi
135+
94136 cat > dist/BlackjackGame/run_game.sh << 'EOF'
95137 #!/bin/bash
96138 echo "Starting Blackjack Game..."
@@ -100,7 +142,6 @@ jobs:
100142 EOF
101143 chmod +x dist/BlackjackGame/run_game.sh
102144
103- # Create instructions file
104145 cat > dist/BlackjackGame/INSTRUCTIONS.txt << 'EOF'
105146 Blackjack Game - Standalone Version
106147 ====================================
@@ -114,19 +155,19 @@ jobs:
114155 Enjoy the game!
115156 EOF
116157
117- # Copy README if it exists
118158 [ -f README.md ] && cp README.md dist/BlackjackGame/
119159
120160 - name : Create TAR archive
121161 run : |
122162 cd dist
123163 tar -czf "../BlackjackGame-Linux-${{ github.event.release.tag_name }}.tar.gz" BlackjackGame/
164+ echo "TAR created. Size: $(du -h "../BlackjackGame-Linux-${{ github.event.release.tag_name }}.tar.gz" | cut -f1)"
124165
125166 - name : Upload release asset
126167 env :
127168 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128169 run : |
129- gh release upload ${{ github.event.release.tag_name }} "BlackjackGame-Linux-${{ github.event.release.tag_name }}.tar.gz"
170+ gh release upload ${{ github.event.release.tag_name }} "BlackjackGame-Linux-${{ github.event.release.tag_name }}.tar.gz" --clobber
130171
131172 build-macos :
132173 runs-on : macos-latest
@@ -148,11 +189,25 @@ jobs:
148189
149190 - name : Build with PyInstaller
150191 run : |
151- pyinstaller --clean blackjack_game.spec
192+ echo "Building with PyInstaller..."
193+ pyinstaller --clean --noconfirm --log-level=DEBUG blackjack_game.spec
194+ echo "Build completed. Checking dist folder:"
195+ ls -la dist/
196+ if [ -d "dist/BlackjackGame" ]; then
197+ echo "BlackjackGame folder contents:"
198+ ls -la dist/BlackjackGame/
199+ else
200+ echo "ERROR: BlackjackGame folder not found in dist/"
201+ exit 1
202+ fi
152203
153204 - name : Create release package
154205 run : |
155- # Create a run script for users
206+ if [ ! -f "dist/BlackjackGame/BlackjackGame" ]; then
207+ echo "ERROR: BlackjackGame executable not found!"
208+ exit 1
209+ fi
210+
156211 cat > dist/BlackjackGame/run_game.sh << 'EOF'
157212 #!/bin/bash
158213 echo "Starting Blackjack Game..."
@@ -162,7 +217,6 @@ jobs:
162217 EOF
163218 chmod +x dist/BlackjackGame/run_game.sh
164219
165- # Create instructions file
166220 cat > dist/BlackjackGame/INSTRUCTIONS.txt << 'EOF'
167221 Blackjack Game - Standalone Version
168222 ====================================
@@ -176,16 +230,16 @@ jobs:
176230 Enjoy the game!
177231 EOF
178232
179- # Copy README if it exists
180233 [ -f README.md ] && cp README.md dist/BlackjackGame/
181234
182235 - name : Create ZIP archive
183236 run : |
184237 cd dist
185238 zip -r "../BlackjackGame-macOS-${{ github.event.release.tag_name }}.zip" BlackjackGame/
239+ echo "ZIP created. Size: $(du -h "../BlackjackGame-macOS-${{ github.event.release.tag_name }}.zip" | cut -f1)"
186240
187241 - name : Upload release asset
188242 env :
189243 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
190244 run : |
191- gh release upload ${{ github.event.release.tag_name }} "BlackjackGame-macOS-${{ github.event.release.tag_name }}.zip"
245+ gh release upload ${{ github.event.release.tag_name }} "BlackjackGame-macOS-${{ github.event.release.tag_name }}.zip" --clobber
0 commit comments