.drone.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. workspace:
  2. base: /media/sf_GOPATH1/src/cwtch.im
  3. path: ui
  4. pipeline:
  5. build-linux:
  6. mem_limit: 3G
  7. image: therecipe/qt:linux
  8. when:
  9. repo: cwtch.im/ui
  10. branch: master
  11. event: [ push, pull_request ]
  12. environment:
  13. - QT_DIR=/opt/Qt
  14. - QT_DOCKER='true'
  15. - QT_API=5.12.0
  16. commands:
  17. - export GOPATH=$GOPATH:/media/sf_GOPATH1/
  18. - export PATH=$PATH:/home/user/work/bin:/media/sf_GOPATH1/bin
  19. - apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git openssh-client
  20. - go get -d
  21. - $QT_DIR/5.12.0/gcc_64/bin/lrelease ui.pro
  22. - git fetch --tags
  23. - export VERSION=`git describe --tags`
  24. - export BUILDDATE=`date +%G-%m-%d-%H-%M`
  25. - qtdeploy -ldflags "-X main.buildVer=$VERSION -X main.buildDate=$BUILDDATE" build linux
  26. - export FILENAME=cwtch-linux-$BUILDDATE.tar.gz
  27. - cd deploy
  28. - mv linux cwtch
  29. - tar -czf $FILENAME cwtch
  30. - sha256sum $FILENAME > $FILENAME.sha256
  31. - rm -r cwtch
  32. build-android:
  33. mem_limit: 3G
  34. image: therecipe/qt:android
  35. when:
  36. repo: cwtch.im/ui
  37. branch: master
  38. event: push
  39. environment:
  40. - QT_DIR=/opt/Qt
  41. - QT_DOCKER='true'
  42. - QT_API=5.12.0
  43. - ANDROID_NDK_DIR=/home/user/android-ndk-r18b
  44. - ANDROID_SDK_DIR=/home/user/android-sdk-linux
  45. commands:
  46. - export GOPATH=$GOPATH:/media/sf_GOPATH1/
  47. - export PATH=$PATH:/home/user/work/bin:/media/sf_GOPATH1/bin
  48. - apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git
  49. - find -iname 'moc*' | xargs rm
  50. - find -iname 'rcc*' | xargs rm
  51. - go get -d
  52. - export VERSION=`git describe --tags`
  53. - export BUILDDATE=`date +%G-%m-%d-%H-%M`
  54. - qtdeploy -ldflags "-X main.buildVer=$VERSION -X main.buildDate=$BUILDDATE" build android
  55. - cd deploy
  56. - export FILENAME=cwtch-android-$BUILDDATE.apk
  57. - cp android/build-debug.apk $FILENAME
  58. - sha256sum $FILENAME > $FILENAME.sha256
  59. build-windows:
  60. mem_limit: 3G
  61. image: therecipe/qt:windows_64_shared
  62. when:
  63. repo: cwtch.im/ui
  64. branch: master
  65. event: push
  66. environment:
  67. - QT_DIR=/opt/Qt
  68. - QT_DOCKER='true'
  69. - QT_API=5.12.0
  70. - ANDROID_NDK_DIR=/home/user/android-ndk-r18b
  71. - ANDROID_SDK_DIR=/home/user/android-sdk-linux
  72. commands:
  73. - export GOPATH=$GOPATH:/media/sf_GOPATH1/
  74. - export PATH=$PATH:/home/user/work/bin:/media/sf_GOPATH1/bin
  75. - apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git zip
  76. - find -iname 'moc*' | xargs rm
  77. - find -iname 'rcc*' | xargs rm
  78. - go get -d
  79. - export VERSION=`git describe --tags`
  80. - export BUILDDATE=`date +%G-%m-%d-%H-%M`
  81. - qtdeploy -ldflags "-X main.buildVer=$VERSION -X main.buildDate=$BUILDDATE" build windows
  82. - cp -r windows/* deploy/windows
  83. - cd deploy
  84. - mv windows cwtch
  85. - export FILENAME=cwtch-windows-$BUILDDATE.zip
  86. - zip -r $FILENAME cwtch
  87. - sha256sum $FILENAME > $FILENAME.sha256
  88. - rm -r cwtch
  89. deploy-buildfiles:
  90. image: pivotaldata/concourse-ssh
  91. secrets: [buildfiles_key]
  92. when:
  93. repo: cwtch.im/ui
  94. branch: master
  95. event: push
  96. status: [ success ]
  97. commands:
  98. - apk add --no-cache git
  99. - echo $BUILDFILES_KEY > ~/id_rsab64
  100. - base64 -d ~/id_rsab64 > ~/id_rsa
  101. - chmod 400 ~/id_rsa
  102. - export DIR=`date +%G.%m.%d-%H.%M`-`git rev-parse --short HEAD`
  103. - cd deploy
  104. - mkdir $DIR
  105. - mv cwtch* $DIR/
  106. - scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
  107. notify-email:
  108. image: drillster/drone-email
  109. host: build.openprivacy.ca
  110. port: 25
  111. skip_verify: true
  112. from: drone@openprivacy.ca
  113. when:
  114. repo: cwtch.im/ui
  115. branch: master
  116. status: [ failure ]
  117. notify-gogs:
  118. image: openpriv/drone-gogs
  119. when:
  120. repo: cwtch.im/ui
  121. branch: master
  122. event: pull_request
  123. status: [ success, changed, failure ]
  124. secrets: [gogs_account_token]
  125. gogs_url: https://git.openprivacy.ca