Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #34 from bakape/package-script

Script for binary package cross-compilation
Cette révision appartient à :
Eliot Whalan 2017-05-05 10:46:45 +10:00 révisé par GitHub
révision b6c5cd9d1d
2 fichiers modifiés avec 23 ajouts et 1 suppressions

4
.gitignore externe
Voir le fichier

@ -2,4 +2,6 @@
*.db
main
nyaa
nyaa-master.exe
nyaa.exe
nyaa-master.exe
*.zip

20
package.sh Fichier exécutable
Voir le fichier

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Helper script to ease building binary packages for multiple targets.
# Requires the linux64 and mingw64 gcc compilers and zip.
# On Debian-based distros install mingw-w64.
version=$(git describe --tags)
declare -a OSes
OSes[0]='linux;x86_64-linux-gnu-gcc'
OSes[1]='windows;x86_64-w64-mingw32-gcc'
for i in "${OSes[@]}"; do
arr=(${i//;/ })
os=${arr[0]}
cc=${arr[1]}
rm -f nyaa nyaa.exe
echo -e "\nBuilding $os..."
echo GOOS=$os GOARCH=amd64 CC=$cc CGO_ENABLED=1 go build -v
GOOS=$os GOARCH=amd64 CC=$cc CGO_ENABLED=1 go build -v
zip -9 -q nyaa-${version}_${os}_amd64.zip css js *.md *.html nyaa nyaa.exe
done