.drone.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 dist/f7-C/f7-update-local/resources
  31. - tar xf dist/f7-C/f7-update-local/resources.tar -C dist/f7-C/f7-update-local/resources
  32. - mv dist/f7-C/f7-update-local/resources/apps/* artifacts-base/
  33. - mv dist/f7-C/f7-update-local/resources/apps_data/totp/* artifacts-totp/
  34. - ls -laS artifacts-base
  35. - ls -laS artifacts-totp
  36. - ls -laS artifacts-totp/plugins
  37. - rm -f artifacts-base/GPIO/gpio.fap
  38. - rm -f artifacts-base/iButton/ibutton.fap
  39. - rm -f artifacts-base/Infrared/infrared.fap
  40. - rm -f artifacts-base/NFC/nfc.fap
  41. - rm -f artifacts-base/RFID/lfrfid.fap
  42. - rm -f artifacts-base/Sub-GHz/subghz_remote.fap
  43. - rm -f artifacts-base/Tools/clock.fap
  44. - rm -f artifacts-base/USB/bad_usb.fap
  45. - rm -f artifacts-base/USB/u2f.fap
  46. - cd ..
  47. - mkdir base_pack_build
  48. - mv unleashed-firmware/artifacts-base/ base_pack_build
  49. - mkdir -p base_pack_build/apps_data/totp
  50. - mv unleashed-firmware/artifacts-totp/* base_pack_build/apps_data/totp/
  51. environment:
  52. FBT_TOOLS_CUSTOM_LINK:
  53. from_secret: fbt_link
  54. - name: "Build extra apps"
  55. image: hfdj/fztools
  56. pull: never
  57. commands:
  58. - rm -rf unleashed-firmware/build/
  59. - rm -rf unleashed-firmware/dist/
  60. - rm -rf unleashed-firmware/.sconsign.dblite
  61. - rm -rf unleashed-firmware/applications_user/*
  62. - mv apps_source_code/* unleashed-firmware/applications_user/
  63. - mv non_catalog_apps/* unleashed-firmware/applications_user/
  64. - cd unleashed-firmware
  65. - export FBT_GIT_SUBMODULE_SHALLOW=1
  66. - ./fbt COMPACT=1 DEBUG=0 updater_package
  67. - mkdir artifacts-extra
  68. - mkdir dist/f7-C/f7-update-local/resources
  69. - tar xf dist/f7-C/f7-update-local/resources.tar -C dist/f7-C/f7-update-local/resources
  70. - mv dist/f7-C/f7-update-local/resources/apps/* artifacts-extra/
  71. - ls -laS artifacts-extra
  72. - rm -f artifacts-extra/GPIO/gpio.fap
  73. - rm -f artifacts-extra/iButton/ibutton.fap
  74. - rm -f artifacts-extra/Infrared/infrared.fap
  75. - rm -f artifacts-extra/NFC/nfc.fap
  76. - rm -f artifacts-extra/RFID/lfrfid.fap
  77. - rm -f artifacts-extra/Sub-GHz/subghz_remote.fap
  78. - rm -f artifacts-extra/Tools/clock.fap
  79. - rm -f artifacts-extra/USB/bad_usb.fap
  80. - rm -f artifacts-extra/USB/u2f.fap
  81. - cd ..
  82. - mkdir extra_pack_build
  83. - mv unleashed-firmware/artifacts-extra/ extra_pack_build
  84. environment:
  85. FBT_TOOLS_CUSTOM_LINK:
  86. from_secret: fbt_link
  87. - name: "Bundle packages"
  88. image: kramos/alpine-zip
  89. commands:
  90. - zip -r all-the-apps-extra.zip extra_pack_build
  91. - zip -r all-the-apps-base.zip base_pack_build
  92. - tar czpf all-the-apps-extra.tgz extra_pack_build
  93. - tar czpf all-the-apps-base.tgz base_pack_build
  94. - mkdir ${DRONE_TAG}
  95. - mv all-the-apps-extra.zip ${DRONE_TAG}/
  96. - mv all-the-apps-base.zip ${DRONE_TAG}/
  97. - mv all-the-apps-extra.tgz ${DRONE_TAG}/
  98. - mv all-the-apps-base.tgz ${DRONE_TAG}/
  99. - rm -rf extra_pack_build
  100. - rm -rf base_pack_build
  101. - rm -rf unleashed-firmware
  102. - ls -laS
  103. - ls -laS ${DRONE_TAG}
  104. - name: "Do Github release"
  105. image: ddplugins/github-release
  106. pull: never
  107. settings:
  108. github_url: https://github.com
  109. repo_owner:
  110. from_secret: github_repoowner
  111. api_key:
  112. from_secret: github_apikey
  113. files:
  114. - ${DRONE_TAG}/*.tgz
  115. - ${DRONE_TAG}/*.zip
  116. title: ${DRONE_TAG}
  117. note: CHANGELOG.md
  118. checksum:
  119. - md5
  120. - sha1
  121. - crc32
  122. trigger:
  123. event:
  124. - tag
  125. node:
  126. typ: haupt