.drone.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. kind: pipeline
  2. type: docker
  3. name: "Build apps"
  4. platform:
  5. os: linux
  6. arch: amd64
  7. steps:
  8. - name: "Update submodules"
  9. image: alpine/git
  10. commands:
  11. - git submodule sync
  12. - git -c protocol.version=2 submodule update --init --force --recursive --jobs 4
  13. - git submodule foreach git config --local gc.auto 0
  14. - git log -1 --format='%H'
  15. - name: "Build base pack"
  16. image: hfdj/fztools
  17. pull: never
  18. commands:
  19. - git clone --branch dev https://github.com/DarkFlippers/unleashed-firmware.git
  20. - rm -rf unleashed-firmware/build/
  21. - rm -rf unleashed-firmware/dist/
  22. - rm -rf unleashed-firmware/.sconsign.dblite
  23. - mv base_pack/* unleashed-firmware/applications_user/
  24. - ./parse_api_ver.sh
  25. - cd unleashed-firmware
  26. - export FBT_GIT_SUBMODULE_SHALLOW=1
  27. - ./fbt COMPACT=1 DEBUG=0 updater_package
  28. - mkdir artifacts-base
  29. - mkdir artifacts-totp
  30. - mkdir artifacts-mfkey
  31. - mkdir dist/f7-C/f7-update-local/resources
  32. - tar xf dist/f7-C/f7-update-local/resources.tar -C dist/f7-C/f7-update-local/resources
  33. - mv dist/f7-C/f7-update-local/resources/apps/* artifacts-base/
  34. - mv dist/f7-C/f7-update-local/resources/apps_data/totp/* artifacts-totp/
  35. - mv dist/f7-C/f7-update-local/resources/apps_data/mfkey/* artifacts-mfkey/
  36. - ls -laS artifacts-base
  37. - ls -laS artifacts-totp/plugins
  38. - ls -laS artifacts-mfkey/plugins
  39. - rm -f artifacts-base/GPIO/gpio.fap
  40. - rm -f artifacts-base/iButton/ibutton.fap
  41. - rm -f artifacts-base/Infrared/infrared.fap
  42. - rm -f artifacts-base/NFC/nfc.fap
  43. - rm -f artifacts-base/RFID/lfrfid.fap
  44. - rm -f artifacts-base/Sub-GHz/subghz_remote.fap
  45. - rm -f artifacts-base/Tools/clock.fap
  46. - rm -f artifacts-base/USB/bad_usb.fap
  47. - rm -f artifacts-base/USB/u2f.fap
  48. - rm -f artifacts-base/Games/snake.fap
  49. - rm -f artifacts-base/USB/hid_usb.fap
  50. - rm -f artifacts-base/Bluetooth/hid_ble.fap
  51. - rm -rf artifacts-base/Scripts/
  52. - cd ..
  53. - mkdir base_pack_build
  54. - mv unleashed-firmware/artifacts-base/ base_pack_build
  55. - mkdir -p base_pack_build/apps_data/totp
  56. - mkdir -p base_pack_build/apps_data/mfkey
  57. - mv unleashed-firmware/artifacts-totp/* base_pack_build/apps_data/totp/
  58. - mv unleashed-firmware/artifacts-mfkey/* base_pack_build/apps_data/mfkey/
  59. environment:
  60. FBT_TOOLS_CUSTOM_LINK:
  61. from_secret: fbt_link
  62. - name: "Build extra apps"
  63. image: hfdj/fztools
  64. pull: never
  65. commands:
  66. - rm -rf unleashed-firmware/build/
  67. - rm -rf unleashed-firmware/dist/
  68. - rm -rf unleashed-firmware/.sconsign.dblite
  69. - rm -rf unleashed-firmware/applications_user/*
  70. - mv apps_source_code/* unleashed-firmware/applications_user/
  71. - mv non_catalog_apps/* unleashed-firmware/applications_user/
  72. - cd unleashed-firmware
  73. - export FBT_GIT_SUBMODULE_SHALLOW=1
  74. - ./fbt COMPACT=1 DEBUG=0 updater_package
  75. - mkdir artifacts-extra
  76. - mkdir dist/f7-C/f7-update-local/resources
  77. - tar xf dist/f7-C/f7-update-local/resources.tar -C dist/f7-C/f7-update-local/resources
  78. - mv dist/f7-C/f7-update-local/resources/apps/* artifacts-extra/
  79. - ls -laS artifacts-extra
  80. - rm -f artifacts-extra/GPIO/gpio.fap
  81. - rm -f artifacts-extra/iButton/ibutton.fap
  82. - rm -f artifacts-extra/Infrared/infrared.fap
  83. - rm -f artifacts-extra/NFC/nfc.fap
  84. - rm -f artifacts-extra/RFID/lfrfid.fap
  85. - rm -f artifacts-extra/Sub-GHz/subghz_remote.fap
  86. - rm -f artifacts-extra/Tools/clock.fap
  87. - rm -f artifacts-extra/USB/bad_usb.fap
  88. - rm -f artifacts-extra/USB/u2f.fap
  89. - rm -f artifacts-extra/Games/snake.fap
  90. - rm -f artifacts-extra/USB/hid_usb.fap
  91. - rm -f artifacts-extra/Bluetooth/hid_ble.fap
  92. - rm -rf artifacts-extra/Scripts/
  93. - cd ..
  94. - mkdir extra_pack_build
  95. - mv unleashed-firmware/artifacts-extra/ extra_pack_build
  96. environment:
  97. FBT_TOOLS_CUSTOM_LINK:
  98. from_secret: fbt_link
  99. - name: "Bundle packages"
  100. image: kramos/alpine-zip
  101. commands:
  102. - zip -r all-the-apps-extra.zip extra_pack_build
  103. - zip -r all-the-apps-base.zip base_pack_build
  104. - tar czpf all-the-apps-extra.tgz extra_pack_build
  105. - tar czpf all-the-apps-base.tgz base_pack_build
  106. - mkdir ${DRONE_TAG}
  107. - mv all-the-apps-extra.zip ${DRONE_TAG}/
  108. - mv all-the-apps-base.zip ${DRONE_TAG}/
  109. - mv all-the-apps-extra.tgz ${DRONE_TAG}/
  110. - mv all-the-apps-base.tgz ${DRONE_TAG}/
  111. - rm -rf extra_pack_build
  112. - rm -rf base_pack_build
  113. - rm -rf unleashed-firmware
  114. - ls -laS
  115. - ls -laS ${DRONE_TAG}
  116. - name: "Do Github release"
  117. image: ddplugins/github-release
  118. pull: never
  119. settings:
  120. github_url: https://github.com
  121. repo_owner:
  122. from_secret: github_repoowner
  123. api_key:
  124. from_secret: github_apikey
  125. files:
  126. - ${DRONE_TAG}/*.tgz
  127. - ${DRONE_TAG}/*.zip
  128. title: ${DRONE_TAG}
  129. note: CHANGELOG.md
  130. checksum:
  131. - md5
  132. - sha1
  133. - crc32
  134. trigger:
  135. event:
  136. - tag
  137. node:
  138. typ: dev1