Browse Source

ci: Add push of -pack branch

Stefan Profanter 5 years ago
parent
commit
86aa563314
4 changed files with 29 additions and 4 deletions
  1. 1 1
      CMakeLists.txt
  2. 1 1
      debian/control
  3. 0 0
      debian/libopen62541-1.install
  4. 27 2
      tools/travis/travis_linux_script.sh

+ 1 - 1
CMakeLists.txt

@@ -1032,7 +1032,7 @@ if (UA_ENABLE_DISCOVERY_MULTICAST)
     target_compile_definitions(open62541 PRIVATE -DMDNSD_DYNAMIC_LINKING_EXPORT)
 endif()
 # Generate properly versioned shared library links on Linux
-SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION 0 VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}")
+SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION "${OPEN62541_VER_MAJOR}" VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}")
 
 ##################################
 #     Architectures changes      #

+ 1 - 1
debian/control

@@ -20,7 +20,7 @@ Depends: open62541 (= ${binary:Version}), ${misc:Depends}
 Description: Development header files for open62541
  open62541 is an open source C (C99) implementation of the OPC UA standard
 
-Package: open62541
+Package: libopen62541-1
 Architecture: any
 Multi-Arch: same
 Depends: ${shlibs:Depends}, ${misc:Depends}

debian/open62541.install → debian/libopen62541-1.install


+ 27 - 2
tools/travis/travis_linux_script.sh

@@ -440,9 +440,9 @@ if ! [ -z ${DEBIAN+x} ]; then
     echo -e "\r\n== Building the Debian package =="  && echo -en 'travis_fold:start:script.build.debian\\r'
     /usr/bin/$PYTHON ./debian/update_changelog.py
     echo -e "\r\n --- New debian changelog content ---"
-    echo -e "--------------------------------------"
+    echo "--------------------------------------"
     cat ./debian/changelog
-    echo -e "--------------------------------------"
+    echo "--------------------------------------"
     dpkg-buildpackage -b
     if [ $? -ne 0 ] ; then exit 1 ; fi
     cp ../open62541*.deb .
@@ -512,6 +512,31 @@ if [ "$CC" != "tcc" ]; then
         echo -en "\r\n==   Building coveralls for ${TRAVIS_REPO_SLUG} ==" && echo -en 'travis_fold:start:script.build.coveralls\\r'
         coveralls -E '.*/build/CMakeFiles/.*' -E '.*/examples/.*' -E '.*/tests/.*' -E '.*\.h' -E '.*CMakeCXXCompilerId\.cpp' -E '.*CMakeCCompilerId\.c' -r ../ || true # ignore result since coveralls is unreachable from time to time
         echo -en 'travis_fold:end:script.build.coveralls\\r'
+
+        if ([ "${TRAVIS_PULL_REQUEST}" = "false" ] &&
+            ([ "${TRAVIS_BRANCH}" == "master" ] || "${TRAVIS_BRANCH}" == "1.0" ] || "${TRAVIS_BRANCH}" == "pack_branch" ])); then
+            # Create a separate branch with the `-pack` postfix. This branch has the correct debian/changelog set, and
+            # The submodules are directly copied
+            echo -e "\r\n== Pushing ${TRAVIS_BRANCH}-pack branch =="  && echo -en 'travis_fold:start:script.build.pack-branch\\r'
+
+            cp -r deps/mdnsd deps/mdnsd_back
+            cp -r deps/ua-nodeset deps/ua-nodeset_back
+            git rm -rf --cached deps/mdnsd
+            git rm -rf --cached deps/ua-nodeset
+            mv deps/mdnsd_back deps/mdnsd
+            rm -rf deps/mdnsd/.git
+            mv deps/ua-nodeset_back deps/ua-nodeset
+            rm -rf deps/ua-nodeset/.git
+            rm -rf .gitmodules
+            git add deps/*
+            git add debian/*
+            git commit -m "[ci skip] Pack with inline submodules"
+            git push -uf origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}-pack
+
+            echo -en 'travis_fold:end:script.build.pack-branch\\r'
+        fi
+
+
     fi
     cd .. && rm build -rf
 fi