forked from Miners/MinusEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.sh
executable file
·45 lines (36 loc) · 873 Bytes
/
pack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
IGNORE_NUSPEC='xxx'
# git
git pull
# nuget restore
nuget restore
# build
xbuild /p:Configuration=Release MinusEngine.sln
xbuild /p:Configuration=Debug MinusEngine.sln
# nuget version
for x in *.nuspec
do
echo $IGNORE_NUSPEC | grep "$x" >/dev/null || (
perl -pi.bak -e 's/<version>([0-9]+)\.([0-9]+)\.([0-9]+)<\/version>/"<version>$1.$2.".($3+1)."<\/version>"/ge; ' "$x"
)
done
MAIN_VERSION=$(grep "<version>" MinusEngine.nuspec | perl -n -e 's/[^0-9.]+//g; print')
# pack
rm -rf nuget-out
mkdir nuget-out
for x in *.nuspec
do
echo $IGNORE_NUSPEC | grep "$x" >/dev/null || (
# Windows Store allows only Release configuration!!!!
nuget pack "$x" -Prop Configuration=Release -OutputDirectory nuget-out
)
done
# git
git add --all
#git commit -a -m "nuget release $MAIN_VERSION"
git push
# push
for x in nuget-out/*.nupkg
do
nuget push "$x"
done