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.

drone.yml 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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: -j 1
  51. # https://wiki.debian.org/CrossCompiling#Building_with_dpkg-buildpackage
  52. BUILD_ARCH: amd64 armhf # amd64 arm64 armel armhf i386 mips mips64el mipsel powerpc ppc64el s390x
  53. commands:
  54. # DEB_BUILD_ARCH DEB_HOST_ARCH TARGET=armhf
  55. # 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
  56. - PKG_NAME="${DRONE_REPO_NAME}" &&
  57. PKG_VERSION="$(git describe --always)" &&
  58. PKG_BUILDHOST_ARCH="amd64" &&
  59. PKG_SRC_ROOT="$(pwd)" &&
  60. PKG_RELEASE_DIR="$${PKG_SRC_ROOT}/release" &&
  61. PKG_DIST_DIR="dist" &&
  62. mkdir -p "$${PKG_RELEASE_DIR}" &&
  63. PKG_DEB_ARCHIVE="$${PKG_NAME}_$${PKG_VERSION}.orig.tar.xz" &&
  64. PKG_DEB_ARCHIVE_ROOT="$${PKG_NAME}-$${PKG_VERSION}" &&
  65. tar --exclude='./.*' --exclude='debian' --exclude="$${PKG_RELEASE_DIR}"
  66. --exclude="$${PKG_DEB_ARCHIVE}"
  67. --transform "s/\./$${PKG_DEB_ARCHIVE_ROOT}/"
  68. -cJf "$${PKG_RELEASE_DIR}/$${PKG_DEB_ARCHIVE}" . &&
  69. for PKG_ARCH in $${BUILD_ARCH} ; do cd "$${PKG_SRC_ROOT}" &&
  70. echo " ░▒▓█ BUILDING FOR $${PKG_ARCH} █▓▒░ " &&
  71. PKG_RELEASE_ARCHIVE="$${PKG_NAME}_$${PKG_VERSION}_$${PKG_ARCH}.tar.xz" &&
  72. PKG_RELEASE_ARCHIVE_ROOT="$${PKG_NAME}-$${PKG_VERSION}" &&
  73. PKG_BUILD_DIR="$${PKG_SRC_ROOT}/build/$${PKG_ARCH}/$${PKG_ARCHIVE_ROOT}" &&
  74. mkdir -p "$${PKG_BUILD_DIR}" &&
  75. tar -xf "$${PKG_RELEASE_DIR}/$${PKG_DEB_ARCHIVE}" -C "$${PKG_BUILD_DIR}" --strip 1 &&
  76. cd "$${PKG_BUILD_DIR}" &&
  77. case "$${PKG_ARCH}" in
  78. amd64) PREFIX="x86_64-linux-gnu-" ;;
  79. arm64) PREFIX="aarch64-linux-gnu-" ;;
  80. armel) PREFIX="arm-linux-gnueabi-" ;;
  81. armhf) PREFIX="arm-linux-gnueabihf-" ;;
  82. i386) PREFIX="i686-linux-gnu-" ;;
  83. mips) PREFIX="mips-linux-gnu-" ;;
  84. mips64el) PREFIX="mips64el-linux-gnuabi64-" ;;
  85. mipsel) PREFIX="mipsel-linux-gnu-" ;;
  86. powerpc) PREFIX="powerpc-linux-gnu-" ;;
  87. ppc64el) PREFIX="powerpc64le-linux-gnu-" ;;
  88. s390x) PREFIX="s390x-linux-gnu-" ;;
  89. esac &&
  90. if test "$${PKG_ARCH}" = "$${PKG_BUILDHOST_ARCH}" ; then PREFIX="" ; fi &&
  91. export CC="$${PREFIX}gcc" &&
  92. export LD="$${PREFIX}ld" &&
  93. export STRIP="$${PREFIX}strip" &&
  94. export MAKEFLAGS="$${MAKEFLAGS}" &&
  95. make &&
  96. tar --exclude='./.*'
  97. --transform "s/\./$${PKG_RELEASE_ARCHIVE_ROOT}/"
  98. -C "$${PKG_DIST_DIR}"
  99. -cJf "$${PKG_RELEASE_DIR}/$${PKG_RELEASE_ARCHIVE}" . &&
  100. make clean ;
  101. done &&
  102. ls -la "$${PKG_RELEASE_DIR}" &&
  103. find "$${PKG_RELEASE_DIR}" -type f -exec md5sum '{}' \;
  104. - exit 0 ; ░▒▓█ BUILD END █▓▒░
  105. # tar --exclude='./.*'
  106. # --transform "s/$${PKG_DIST_DIR}/$${PKG_RELEASE_ARCHIVE_ROOT}/"
  107. # -cJvf "$${PKG_RELEASE_DIR}/$${PKG_RELEASE_ARCHIVE}" "${PKG_DIST_DIR}" &&
  108. # - export MAKEFLAGS && make
  109. # - CONTENT=${DRONE_REPO_NAME} ;
  110. # test -n "${DRONE_TAG}" &&
  111. # RELEASE=${DRONE_REPO_NAME}-${DRONE_TAG}-bin ||
  112. # RELEASE=${DRONE_REPO_NAME}-bin
  113. # - cp -rp dist/. $CONTENT/ ;
  114. # ls -la $CONTENT
  115. # - find $CONTENT -type f -exec md5sum '{}' \;
  116. # - rm -rf release ;
  117. # mkdir release
  118. # # - zip -rpq release/$RELEASE.zip $CONTENT
  119. # - tar -czf release/$RELEASE.tar.gz $CONTENT
  120. # # - tar -cJf release/$RELEASE.tar.xz $CONTENT
  121. # - make clean ; rm -rf $CONTENT ;
  122. # ls -la release
  123. # - find release -type f -exec md5sum '{}' \;
  124. # - for ARCH in ${BUILD_ARCH} ; do
  125. # apt-get build-dep -a $ARCH . ;
  126. # done
  127. # - for ARCH in ${BUILD_ARCH} ; do
  128. # CONFIG_SITE=/etc/dpkg-cross/cross-config.$ARCH
  129. # DEB_BUILD_OPTIONS=nocheck
  130. # dpkg-buildpackage -us -uc -a $ARCH ;
  131. # done
  132. # - exit 0 ; ░▒▓█ BUILD END █▓▒░
  133. - name: sign
  134. image: plugins/gpgsign
  135. # http://plugins.drone.io/drone-plugins/drone-gpgsign/
  136. # https://github.com/drone-plugins/drone-gpgsign
  137. when:
  138. event: [ push, tag ]
  139. depends_on: [ build ]
  140. settings:
  141. key: { from_secret: gpg-key }
  142. passphrase: { from_secret: gpg-pass }
  143. detach_sign: true
  144. clear_sign: false
  145. files:
  146. - release/*
  147. excludes:
  148. - release/*.asc
  149. # http://plugins.drone.io/drone-plugins/drone-gitea-release/
  150. # https://github.com/drone-plugins/drone-gitea-release
  151. - name: release
  152. image: plugins/gitea-release
  153. # http://plugins.drone.io/drone-plugins/drone-gitea-release/
  154. # https://github.com/drone-plugins/drone-gitea-release
  155. when:
  156. event: [ tag ]
  157. depends_on: [ sign ]
  158. settings:
  159. title: Release ${DRONE_REPO_NAME}-${DRONE_TAG} # file or string
  160. note: RELEASE.md # file or string
  161. draft: false
  162. prerelease: false
  163. base_url: https://git.unino.de
  164. insecure: false
  165. api_key: { from_secret: gitea-release }
  166. checksum: [ md5 ] # [ md5, sha1, sha256, sha512, adler32, crc32 ]
  167. file_exists: overwrite # overwrite, skip, fail
  168. files: # wildcard * matching files with prefix supported
  169. - release/*