소스 검색

CI testing

MX 2 년 전
부모
커밋
6b3a98a25f
2개의 변경된 파일141개의 추가작업 그리고 0개의 파일을 삭제
  1. 126 0
      .drone.yml
  2. 15 0
      parse_api_ver.sh

+ 126 - 0
.drone.yml

@@ -0,0 +1,126 @@
+kind: pipeline
+type: docker
+name: "Build apps"
+
+platform:
+  os: linux
+  arch: amd64
+
+steps:
+  - name: "Update submodules"
+    image: alpine/git
+    commands: 
+      - git submodule sync
+      - git -c protocol.version=2 submodule update --init --force --recursive --jobs 4
+      - git submodule foreach git config --local gc.auto 0
+      - git log -1 --format='%H'
+
+  - name: "Build base pack"
+    image: hfdj/fztools
+    pull: never
+    commands:
+      - git clone --branch dev https://github.com/DarkFlippers/unleashed-firmware.git
+      - rm -rf unleashed-firmware/assets/resources/apps/
+      - rm -rf unleashed-firmware/build/
+      - rm -rf unleashed-firmware/dist/
+      - rm -rf unleashed-firmware/.sconsign.dblite
+      - mv base_pack/* unleashed-firmware/applications_user/
+      - ./parse_api_ver.sh
+      - cd unleashed-firmware
+      - ./fbt COMPACT=1 DEBUG=0 updater_package
+      - mkdir artifacts-base
+      - mv assets/resources/apps/* artifacts-base/
+      - ls -laS artifacts-base
+      - rm -f artifacts-base/GPIO/gpio.fap
+      - rm -f artifacts-base/iButton/ibutton.fap
+      - rm -f artifacts-base/Infrared/infrared.fap
+      - rm -f artifacts-base/NFC/nfc.fap
+      - rm -f artifacts-base/RFID/lfrfid.fap
+      - rm -f artifacts-base/Sub-Ghz/subghz_remote.fap
+      - rm -f artifacts-base/Tools/clock.fap
+      - rm -f artifacts-base/USB/bad_usb.fap
+      - rm -f artifacts-base/USB/u2f.fap
+      - cd ..
+      - mkdir base_pack_build
+      - mv unleashed-firmware/artifacts-base/ base_pack_build
+    environment:
+      FBT_TOOLS_CUSTOM_LINK:
+        from_secret: fbt_link
+
+  - name: "Build extra apps"
+    image: hfdj/fztools
+    pull: never
+    commands:
+      - rm -rf unleashed-firmware/assets/resources/apps/
+      - rm -rf unleashed-firmware/build/
+      - rm -rf unleashed-firmware/dist/
+      - rm -rf unleashed-firmware/.sconsign.dblite
+      - rm -rf unleashed-firmware/applications_user/*
+      - mv apps_source_code/* unleashed-firmware/applications_user/
+      - mv non_catalog_apps/* unleashed-firmware/applications_user/
+      - cd unleashed-firmware
+      - ./fbt COMPACT=1 DEBUG=0 updater_package
+      - mkdir artifacts-extra
+      - mv assets/resources/apps/* artifacts-extra/
+      - ls -laS artifacts-extra
+      - rm -f artifacts-extra/GPIO/gpio.fap
+      - rm -f artifacts-extra/iButton/ibutton.fap
+      - rm -f artifacts-extra/Infrared/infrared.fap
+      - rm -f artifacts-extra/NFC/nfc.fap
+      - rm -f artifacts-extra/RFID/lfrfid.fap
+      - rm -f artifacts-extra/Sub-Ghz/subghz_remote.fap
+      - rm -f artifacts-extra/Tools/clock.fap
+      - rm -f artifacts-extra/USB/bad_usb.fap
+      - rm -f artifacts-extra/USB/u2f.fap
+      - cd ..
+      - mkdir extra_pack_build
+      - mv unleashed-firmware/artifacts-extra/ extra_pack_build
+    environment:
+      FBT_TOOLS_CUSTOM_LINK:
+        from_secret: fbt_link
+
+  - name: "Bundle packages"
+    image: kramos/alpine-zip
+    commands:
+      - zip -r all-the-apps-extra.zip extra_pack_build
+      - zip -r all-the-apps-base.zip base_pack_build
+      - tar czpf all-the-apps-extra.tgz extra_pack_build
+      - tar czpf all-the-apps-base.tgz base_pack_build
+      - mkdir publish
+      - mv all-the-apps-extra.zip publish/
+      - mv all-the-apps-base.zip publish/
+      - mv all-the-apps-extra.tgz publish/
+      - mv all-the-apps-base.tgz publish/
+      - rm -rf extra_pack_build
+      - rm -rf base_pack_build
+      - rm -rf unleashed-firmware
+      - ls -laS
+      - ls -laS publish
+
+  - name: "Do Github release"
+    image: ddplugins/github-release
+    pull: never
+    settings:
+      github_url: https://github.com
+      repo_owner:
+        from_secret: github_repoowner
+      api_key:
+        from_secret: github_apikey
+      files:
+        - publish/*.tgz
+        - publish/*.zip
+      title: ${DRONE_BUILD_NUMBER}
+      note: changelog.md
+      checksum:
+        - md5
+        - sha1
+        - crc32
+
+trigger:
+  branch:
+    - dev
+  event:
+    - push
+
+node:
+  typ: haupt

+ 15 - 0
parse_api_ver.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+# Parse API Version from api_symbols.csv
+FILE=unleashed-firmware/firmware/targets/f7/api_symbols.csv
+OLDIFS=$IFS
+IFS=','
+[ ! -f $FILE ] && { echo "$FILE not found"; exit 99; }
+while read entry status name type params
+do
+	if [ "$entry" == "Version" ]; then
+		echo "API: $name"
+		echo "Apps build for Unleashed FW with API version: $name" > changelog.md
+		break;
+	fi
+done < $FILE
+IFS=$OLDIFS