mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-09 14:46:39 +08:00
.zip for Win/Mac, .tar.gz for Linux/BSD
This commit is contained in:
23
dist/automate.sh
vendored
23
dist/automate.sh
vendored
@ -19,28 +19,37 @@ ReleaseDir=$DistDir/release
|
|||||||
# Compile binaries
|
# Compile binaries
|
||||||
mkdir -p $BuildDir
|
mkdir -p $BuildDir
|
||||||
cd $BuildDir
|
cd $BuildDir
|
||||||
rm -f *
|
rm -f caddy*
|
||||||
gox $Package
|
gox $Package
|
||||||
|
|
||||||
# Zip them up with release notes and stuff
|
# Zip them up with release notes and stuff
|
||||||
mkdir -p $ReleaseDir
|
mkdir -p $ReleaseDir
|
||||||
cd $ReleaseDir
|
cd $ReleaseDir
|
||||||
rm -f *
|
rm -f caddy*
|
||||||
for f in $BuildDir/*
|
for f in $BuildDir/*
|
||||||
do
|
do
|
||||||
# Name .zip file same as binary, but strip .exe from end
|
# Name .zip file same as binary, but strip .exe from end
|
||||||
zipname=$(basename ${f%".exe"}).zip
|
zipname=$(basename ${f%".exe"})
|
||||||
|
if [[ $f == *"linux"* ]] || [[ $f == *"bsd"* ]]; then
|
||||||
|
zipname=${zipname}.tar.gz
|
||||||
|
else
|
||||||
|
zipname=${zipname}.zip
|
||||||
|
fi
|
||||||
|
|
||||||
# Binary inside the zip file is simply the project name
|
# Binary inside the zip file is simply the project name
|
||||||
bin=$BuildDir/$(basename $Package)
|
binbase=$(basename $Package)
|
||||||
if [[ $f == *.exe ]]
|
if [[ $f == *.exe ]]; then
|
||||||
then
|
binbase=$binbase.exe
|
||||||
bin=$bin.exe
|
|
||||||
fi
|
fi
|
||||||
|
bin=$BuildDir/$binbase
|
||||||
mv $f $bin
|
mv $f $bin
|
||||||
|
|
||||||
# Compress distributable
|
# Compress distributable
|
||||||
|
if [[ $zipname == *.zip ]]; then
|
||||||
zip -j $zipname $bin $DistDir/CHANGES.txt $DistDir/LICENSES.txt $DistDir/README.txt
|
zip -j $zipname $bin $DistDir/CHANGES.txt $DistDir/LICENSES.txt $DistDir/README.txt
|
||||||
|
else
|
||||||
|
tar -cvzf $zipname -C $BuildDir $binbase -C $DistDir CHANGES.txt LICENSES.txt README.txt
|
||||||
|
fi
|
||||||
|
|
||||||
# Put binary filename back to original
|
# Put binary filename back to original
|
||||||
mv $bin $f
|
mv $bin $f
|
||||||
|
Reference in New Issue
Block a user