From ae606257e9a6302c7ce2cb69a877b1fbbc268b0e Mon Sep 17 00:00:00 2001 From: hedger Date: Thu, 8 Jun 2023 15:35:54 +0400 Subject: [PATCH 1/6] github: added debugapps artifact; packaging resources per-target --- .github/workflows/build.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb0f13e207f..26ff300b553 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,10 +52,8 @@ jobs: - name: 'Make artifacts directory' run: | - rm -rf artifacts - rm -rf map_analyser_files - mkdir artifacts - mkdir map_analyser_files + rm -rf artifacts map_analyser_files + mkdir artifacts map_analyser_files - name: 'Bundle scripts' if: ${{ !github.event.pull_request.head.repo.fork }} @@ -68,15 +66,13 @@ jobs: for TARGET in ${TARGETS}; do TARGET="$(echo "${TARGET}" | sed 's/f//')"; \ ./fbt TARGET_HW=$TARGET copro_dist updater_package \ - ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }} - done - - - name: 'Move upload files' - if: ${{ !github.event.pull_request.head.repo.fork }} - run: | - set -e - for TARGET in ${TARGETS}; do + ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }} mv dist/${TARGET}-*/* artifacts/ + tar czpf "artifacts/flipper-z-${TARGET}-resources-${SUFFIX}.tgz" \ + -C assets resources + ./fbt TARGET_HW=$TARGET fap_dist + tar czpf "artifacts/flipper-z-${TARGET}-debugapps-${SUFFIX}.tgz" \ + -C dist/${TARGET}-*/apps/Debug dist/${TARGET}-*/apps/Debug done - name: "Check for uncommitted changes" @@ -86,7 +82,6 @@ jobs: - name: 'Bundle resources' if: ${{ !github.event.pull_request.head.repo.fork }} run: | - tar czpf "artifacts/flipper-z-any-resources-${SUFFIX}.tgz" -C assets resources - name: 'Bundle core2 firmware' if: ${{ !github.event.pull_request.head.repo.fork }} From b6c461db44c26dced471387ef65cebf5590d781e Mon Sep 17 00:00:00 2001 From: hedger Date: Thu, 8 Jun 2023 15:40:53 +0400 Subject: [PATCH 2/6] github: target name fixes --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26ff300b553..72e7d6a89f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,13 +64,13 @@ jobs: run: | set -e for TARGET in ${TARGETS}; do - TARGET="$(echo "${TARGET}" | sed 's/f//')"; \ - ./fbt TARGET_HW=$TARGET copro_dist updater_package \ + TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \ + ./fbt TARGET_HW=$TARGET_HW copro_dist updater_package \ ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }} mv dist/${TARGET}-*/* artifacts/ tar czpf "artifacts/flipper-z-${TARGET}-resources-${SUFFIX}.tgz" \ -C assets resources - ./fbt TARGET_HW=$TARGET fap_dist + ./fbt TARGET_HW=$TARGET_HW fap_dist tar czpf "artifacts/flipper-z-${TARGET}-debugapps-${SUFFIX}.tgz" \ -C dist/${TARGET}-*/apps/Debug dist/${TARGET}-*/apps/Debug done From 86323deb07603fbee23feb7fb3f30e2b2bdab888 Mon Sep 17 00:00:00 2001 From: hedger Date: Thu, 8 Jun 2023 15:45:30 +0400 Subject: [PATCH 3/6] github: fixed path for debug apps --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72e7d6a89f6..b50a3aedce4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,7 +72,7 @@ jobs: -C assets resources ./fbt TARGET_HW=$TARGET_HW fap_dist tar czpf "artifacts/flipper-z-${TARGET}-debugapps-${SUFFIX}.tgz" \ - -C dist/${TARGET}-*/apps/Debug dist/${TARGET}-*/apps/Debug + -C dist/${TARGET}-*/apps/Debug . done - name: "Check for uncommitted changes" From 6529ff09f8eb369baebeb2b6d87925a060fe0b24 Mon Sep 17 00:00:00 2001 From: hedger Date: Thu, 8 Jun 2023 16:02:17 +0400 Subject: [PATCH 4/6] scripts: dist: removed lib stub artifact --- scripts/sconsdist.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/scripts/sconsdist.py b/scripts/sconsdist.py index 23f9526a0b5..ef109368370 100644 --- a/scripts/sconsdist.py +++ b/scripts/sconsdist.py @@ -80,21 +80,10 @@ def copy_single_project(self, project: ProjectDir) -> None: src_file, self.get_dist_path(self.get_project_file_name(project, filetype)), ) - for foldertype in ("sdk_headers", "lib"): + for foldertype in ("sdk_headers",): if exists(sdk_folder := join(obj_directory, foldertype)): self.note_dist_component(foldertype, "dir", sdk_folder) - # TODO: remove this after everyone migrates to new uFBT - self.create_zip_stub("lib") - - def create_zip_stub(self, foldertype): - with zipfile.ZipFile( - self.get_dist_path(self.get_dist_file_name(foldertype, "zip")), - "w", - zipfile.ZIP_DEFLATED, - ) as _: - pass - def copy(self) -> int: self._dist_components: dict[str, str] = dict() self.projects: dict[str, ProjectDir] = dict( @@ -169,7 +158,6 @@ def bundle_sdk(self): "firmware.elf", "update.dir", "sdk_headers.dir", - "lib.dir", "scripts.dir", ) From 40ed7d93e897aba1d1188adc1d0a2ef3f730fc14 Mon Sep 17 00:00:00 2001 From: hedger Date: Thu, 8 Jun 2023 16:31:30 +0400 Subject: [PATCH 5/6] scripts: fixed broken SDK --- scripts/sconsdist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/sconsdist.py b/scripts/sconsdist.py index ef109368370..2cf43dce02a 100644 --- a/scripts/sconsdist.py +++ b/scripts/sconsdist.py @@ -80,7 +80,7 @@ def copy_single_project(self, project: ProjectDir) -> None: src_file, self.get_dist_path(self.get_project_file_name(project, filetype)), ) - for foldertype in ("sdk_headers",): + for foldertype in ("sdk_headers", "lib"): if exists(sdk_folder := join(obj_directory, foldertype)): self.note_dist_component(foldertype, "dir", sdk_folder) @@ -158,6 +158,7 @@ def bundle_sdk(self): "firmware.elf", "update.dir", "sdk_headers.dir", + "lib.dir", "scripts.dir", ) From a3fd8df83df4ad710e34fba271f38492aa315175 Mon Sep 17 00:00:00 2001 From: hedger Date: Thu, 8 Jun 2023 16:32:37 +0400 Subject: [PATCH 6/6] github: removed unused step --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b50a3aedce4..9fbcb16ebeb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,10 +79,6 @@ jobs: run: | git diff --exit-code - - name: 'Bundle resources' - if: ${{ !github.event.pull_request.head.repo.fork }} - run: | - - name: 'Bundle core2 firmware' if: ${{ !github.event.pull_request.head.repo.fork }} run: |