File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,21 @@ jobs:
2121 $sha256 = (Get-FileHash -Path src/python/rag.py -Algorithm SHA256).Hash
2222 echo "Current SHA256: $sha256"
2323 $previous_sha256 = "${{ github.event.before }}"
24- if ($previous_sha256) {
24+ if ($previous_sha256 -and $previous_sha256 -ne "0000000000000000000000000000000000000000" ) {
2525 $previous_content = git show $previous_sha256:src/python/rag.py 2>$null
2626 if ($?) {
27- echo $previous_content | Out-File temp_rag.py
27+ echo $previous_content | Out-File temp_rag.py -Encoding utf8
2828 $previous_hash = (Get-FileHash -Path temp_rag.py -Algorithm SHA256).Hash
2929 if ($previous_hash -eq $sha256) {
3030 echo "No changes detected in rag.py, skipping build and release."
31+ Remove-Item -Path temp_rag.py -Force -ErrorAction SilentlyContinue
3132 exit 0
3233 }
3334 }
3435 }
36+ Remove-Item -Path temp_rag.py -Force -ErrorAction SilentlyContinue
3537 echo "Building new rag.exe due to changes or no previous commit."
38+ shell : pwsh
3639
3740 # Set up Python
3841 - name : Set up Python
5457 mkdir temp_dist
5558 pyinstaller --onefile --clean --distpath temp_dist src/python/rag.py
5659 if ($LASTEXITCODE -ne 0) { throw "PyInstaller build failed" }
60+ shell : pwsh
5761
5862 # Compress EXE with UPX
5963 - name : Compress EXE with UPX
8892 # Clean up temporary directory
8993 - name : Clean up temporary directory
9094 if : always()
91- run : Remove-Item -Path temp_dist -Recurse -Force -ErrorAction SilentlyContinue
95+ run : |
96+ Remove-Item -Path temp_dist -Recurse -Force -ErrorAction SilentlyContinue
97+ Remove-Item -Path temp_rag.py -Force -ErrorAction SilentlyContinue
98+ shell : pwsh
9299
93100 build-and-publish :
94101 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments