Add csapi-tizenfx-debug package including .pdb files
[platform/core/csapi/tizenfx.git] / .gitwork / publish.sh
1 #!/bin/bash
2
3 SCRIPT_FILE=$(readlink -f $0)
4 SCRIPT_DIR=$(dirname $SCRIPT_FILE)
5 ROOT_DIR=$(readlink -f $SCRIPT_DIR/..)
6 BIN_DIR=$ROOT_DIR/binaries
7 VERSION_FILE=$BIN_DIR/Version.txt
8
9 # Prepare
10 git rm -fr $BIN_DIR
11 rm -fr $BIN_DIR
12 mv $ROOT_DIR/temp $BIN_DIR
13 git add $BIN_DIR
14
15 # Check changes
16 CHK=$(git diff --cached -- $VERSION_FILE | wc -l)
17 if [ $CHK -eq 0 ]; then
18   echo "No Changes, Skip!!"
19         exit 0
20 fi
21
22 PACKAGE_FILE=$ROOT_DIR/packaging/csapi-tizenfx.spec
23 PACKAGE_IN_FILE=$PACKAGE_FILE.in
24
25 GetValue() {
26         cat $VERSION_FILE | grep $1 | cut -d: -f2 | sed 's/\r$//'
27 }
28
29 VERSION_PREFIX=$(GetValue Prefix)
30 VERSION_SUFFIX=$(GetValue Suffix)
31 VERSION_BUILD_NUMBER=$(GetValue Number)
32 VERSION_VCS=$(GetValue VCS)
33 VERSION_STRING="$VERSION_PREFIX-$VERSION_SUFFIX"
34
35 # Make .spec file with rpm_version
36 RPM_VERSION="$VERSION_PREFIX.$VERSION_BUILD_NUMBER"
37 sed -e "s/%rpm_version%/$RPM_VERSION/g" $PACKAGE_IN_FILE > $PACKAGE_FILE
38
39 # Git Works
40 git config user.email "dotnetbuild.tizen@gmail.com"
41 git config user.name "DotnetBuild"
42
43 git add $ROOT_DIR/packaging
44
45 git fetch origin master
46 git checkout $VERSION_VCS -- src 
47 git checkout $VERSION_VCS -- pkg
48 git checkout $VERSION_VCS -- build
49
50 git commit -m "Release $VERSION_STRING"
51
52 git push origin tizen
53