Kromek Radangel gamma spectrometer USB HID daemon and WebUI. https://git.unino.de/pvivell/radangel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. kind: pipeline
  2. name: clone-prepare-build-sign-release
  3. # https://github.com/drone/drone
  4. platform:
  5. os: linux
  6. arch: amd64
  7. clone:
  8. disable: false
  9. depth: 50
  10. steps:
  11. - name: prepare
  12. image: plugins/docker
  13. # http://plugins.drone.io/drone-plugins/drone-docker/
  14. # https://github.com/drone-plugins/drone-docker
  15. when:
  16. event: [ tag ] # [ push, tag ]
  17. settings:
  18. dry_run: false
  19. registry: reg.unino.de
  20. insecure: false
  21. #auth: authtoken for registry
  22. username: { from_secret: reg-user }
  23. password: { from_secret: reg-pass }
  24. repo: reg.unino.de/develop/debian-${DRONE_REPO_NAMESPACE}-${DRONE_REPO_NAME}
  25. #mirror: registry-1.docker.io
  26. bip: 172.17.0.1/16 # set bridge if non-existent
  27. context: /drone/src # defaults to root of git repo
  28. #custom_dns: 127.0.0.11 # defaults to 8.8.8.8 and 8.8.4.4
  29. storage_driver: overlay2 # aufs, overlay or vfs
  30. #debug: true
  31. #launch_debug: true
  32. target: builder # Dockerfile build target e.g. builder, debug, production
  33. dockerfile: Dockerfile
  34. auto_tag: false
  35. auto_tag_suffix: linux-amd64
  36. force_tag: true
  37. tags: [ latest, builder ]
  38. build_args: # custom args for docker build, e.g. additional BUILD_DEPS etc.
  39. - DEB_RELEASE=stretch
  40. - BUILD_DEPS=libhidapi-dev libssl-dev
  41. - BUILD_ARCH=armhf # amd64 arm64 armel armhf i386 mips mips64el mipsel powerpc ppc64el s390x
  42. - name: build
  43. image: reg.unino.de/develop/debian-${DRONE_REPO_NAMESPACE}-${DRONE_REPO_NAME}:latest
  44. # https://readme.drone.io/user-guide/pipeline/
  45. # https://docs.drone.io/reference/environ/
  46. when:
  47. event: [ push, tag ]
  48. depends_on: [ clone, prepare ]
  49. environment:
  50. MAKEFLAGS: -j2
  51. # https://wiki.debian.org/CrossCompiling#Building_with_dpkg-buildpackage
  52. # https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
  53. # https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#Catalogue-of-Rules
  54. # BINARIES for PREFIX: addr2line ar as c++filt cpp cpp-6 dwp elfedit g++ g++-6 gcc gcc-6 gcc-ar gcc-ar-6 gcc-nm gcc-nm-6 gcc-ranlib gcc-ranlib-6 gcov gcov-6 gcov-dump gcov-dump-6 gcov-tool gcov-tool-6 gprof ld ld.bfd ld.gold nm objcopy objdump ranlib readelf size strings strip
  55. BUILD_ARCH: amd64 armhf # amd64 arm64 armel armhf i386 mips mips64el mipsel powerpc ppc64el s390x
  56. commands:
  57. - NAME="${DRONE_REPO_NAME}" ;
  58. VERSION="$(git describe --always)" ;
  59. if test -d "debian" ; then
  60. VERSION=$(dpkg-parsechangelog -SVersion | sed 's/-.*//') ;
  61. fi ;
  62. DESTDIR="dist" ;
  63. RELEASE_DIR="release" ;
  64. ARCHIVE_NAME="$${NAME}_$${VERSION}" ;
  65. ARCHIVE_ROOT="$${NAME}-$${VERSION}" ;
  66. SRC_DIR="$(pwd)" ;
  67. - mkdir -p "$${RELEASE_DIR}" &&
  68. tar --exclude='./.*' --exclude='debian' --exclude="$${RELEASE_DIR}"
  69. --transform "s/\./$${ARCHIVE_ROOT}/"
  70. -cJf "$${SRC_DIR}/$${RELEASE_DIR}/$${ARCHIVE_NAME}.orig.tar.xz" .
  71. - for ARCH in $${BUILD_ARCH} ; do set -e ;
  72. echo " ░▒▓█ BUILDING for architecture \"$${ARCH}\" █▓▒░ " ;
  73. BUILD_DIR="$${SRC_DIR}/build/$${ARCH}/$${ARCHIVE_ROOT}" ;
  74. case "$${ARCH}" in
  75. amd64) PREFIX="x86_64-linux-gnu-" ;;
  76. arm64) PREFIX="aarch64-linux-gnu-" ;;
  77. armel) PREFIX="arm-linux-gnueabi-" ;;
  78. armhf) PREFIX="arm-linux-gnueabihf-" ;;
  79. i386) PREFIX="i686-linux-gnu-" ;;
  80. mips) PREFIX="mips-linux-gnu-" ;;
  81. mips64el) PREFIX="mips64el-linux-gnuabi64-" ;;
  82. mipsel) PREFIX="mipsel-linux-gnu-" ;;
  83. powerpc) PREFIX="powerpc-linux-gnu-" ;;
  84. ppc64el) PREFIX="powerpc64le-linux-gnu-" ;;
  85. s390x) PREFIX="s390x-linux-gnu-" ;;
  86. *) PREFIX="" ;;
  87. esac ;
  88. if test "$${ARCH}" = "$(dpkg --print-architecture)" ; then
  89. PREFIX="" ;
  90. else
  91. export CONFIG_SITE="/etc/dpkg-cross/cross-config.$${ARCH}" ;
  92. fi ;
  93. export CC="$${PREFIX}gcc" ;
  94. export CXX="$${PREFIX}g++" ;
  95. export LD="$${PREFIX}ld" ;
  96. export STRIP="$${PREFIX}strip" ;
  97. export MAKEFLAGS="$${MAKEFLAGS}" ;
  98. mkdir -p "$${BUILD_DIR}" ;
  99. cd "$${BUILD_DIR}" ;
  100. tar -xf "$${SRC_DIR}/$${RELEASE_DIR}/$${ARCHIVE_NAME}.orig.tar.xz"
  101. -C "$${BUILD_DIR}" --strip 1 ;
  102. cp -p "$${SRC_DIR}/$${RELEASE_DIR}/$${ARCHIVE_NAME}.orig.tar.xz"
  103. "$${BUILD_DIR}/../" ;
  104. if test -d "$${SRC_DIR}/debian" ; then
  105. cp -rp "$${SRC_DIR}/debian"
  106. "$${BUILD_DIR}/" ;
  107. export DEBIAN_FRONTEND="noninteractive" ;
  108. export DEB_BUILD_OPTIONS="nocheck" ;
  109. apt-get -qy -o Dpkg::Use-Pty=0 build-dep -a $${ARCH} . ;
  110. dpkg-buildpackage -us -uc -a "$${ARCH}" &&
  111. cp ../*.tar.xz ../*.deb ../*.dsc "$${SRC_DIR}/$${RELEASE_DIR}/" &&
  112. ls -la .. ;
  113. make clean ;
  114. else
  115. make &&
  116. make install ;
  117. tar --exclude='./.*'
  118. --transform "s/\./$${ARCHIVE_ROOT}/"
  119. -C "$${BUILD_DIR}/$${DESTDIR}"
  120. -cJf "$${SRC_DIR}/$${RELEASE_DIR}/$${ARCHIVE_NAME}.$${ARCH}.tar.xz" . &&
  121. ls -la "$${SRC_DIR}/$${RELEASE_DIR}/$${ARCHIVE_NAME}.$${ARCH}.tar.xz" ;
  122. make clean ;
  123. fi ;
  124. cd "$${SRC_DIR}" ;
  125. done
  126. - ls -la "$${SRC_DIR}/$${RELEASE_DIR}" &&
  127. find "$${SRC_DIR}/$${RELEASE_DIR}" -type f -exec md5sum '{}' \;
  128. - exit 0 ; ░▒▓█ BUILD END █▓▒░
  129. - name: sign
  130. image: plugins/gpgsign
  131. # http://plugins.drone.io/drone-plugins/drone-gpgsign/
  132. # https://github.com/drone-plugins/drone-gpgsign
  133. when:
  134. event: [ push, tag ]
  135. depends_on: [ build ]
  136. settings:
  137. key: { from_secret: gpg-key }
  138. passphrase: { from_secret: gpg-pass }
  139. detach_sign: true
  140. clear_sign: false
  141. files:
  142. - release/*
  143. excludes:
  144. - release/*.asc
  145. # http://plugins.drone.io/drone-plugins/drone-gitea-release/
  146. # https://github.com/drone-plugins/drone-gitea-release
  147. - name: release
  148. image: plugins/gitea-release
  149. # http://plugins.drone.io/drone-plugins/drone-gitea-release/
  150. # https://github.com/drone-plugins/drone-gitea-release
  151. when:
  152. event: [ tag ]
  153. depends_on: [ sign ]
  154. settings:
  155. title: Release ${DRONE_REPO_NAME}-${DRONE_TAG} # file or string
  156. note: RELEASE.md # file or string
  157. draft: false
  158. prerelease: false
  159. base_url: https://git.unino.de
  160. insecure: false
  161. api_key: { from_secret: gitea-release } # create gitea-release access token in /user/settings/applications
  162. checksum: [ md5 ] # [ md5, sha1, sha256, sha512, adler32, crc32 ]
  163. file_exists: overwrite # overwrite, skip, fail
  164. files: # wildcard * matching files with prefix supported
  165. - release/*