Skip to content

Instantly share code, notes, and snippets.

@K-Wu
Created March 3, 2017 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save K-Wu/36cbe47b1dd59c69c90507c58d4b7ec2 to your computer and use it in GitHub Desktop.
Save K-Wu/36cbe47b1dd59c69c90507c58d4b7ec2 to your computer and use it in GitHub Desktop.
building windows executable from latest commit for python repo
:: This is one script for auto package necessary files distributed to competitors for TeamStyle18 programming contest @EE.THU
:: github-release.exe is built from https://github.com/c4milo/github-release
cd teamstyle18
set GITHUB_TOKEN=[redacted]
git pull origin master
pyinstaller --onefile src/main.py
rename dist\main.exe dist\cpclash.exe
git log --oneline >githashtmp.txt
set /p latestcommit=<githashtmp.txt
set hash=%latestcommit:~0,6%
"C:\Program Files (x86)\7-Zip\7z.exe" a cpclash%hash%.zip player_files\ cpclash.exe
"C:\Program Files (x86)\7-Zip\7z.exe" d cpclash%hash%.zip player_files\sample
cd ..
github-release.exe K-Wu/ts18-release-kwu %hash% master "automated packaging" teamstyle18\cpclash%hash%.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment