From e5f0f209e7c0a393f119ad5ca5cff5eca96dc74e Mon Sep 17 00:00:00 2001 From: James Bowman Date: Fri, 12 Feb 2021 19:31:34 -0800 Subject: [PATCH 1/3] New script build.sh New script build.sh, correctly adds the Package Folder Prefix to the build line README updated to use build.sh [adafruit/circuitpython-build-tools#6] --- README.md | 2 +- build.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 build.sh diff --git a/README.md b/README.md index d6a5a36..e85ba77 100644 --- a/README.md +++ b/README.md @@ -60,4 +60,4 @@ Once installed, make sure you are in the virtual environment: Then run the build: - circuitpython-build-bundles --filename_prefix circuitpython-community-bundle --library_location libraries --library_depth 2 + ./build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..3de5562 --- /dev/null +++ b/build.sh @@ -0,0 +1,35 @@ +#! /bin/bash + +# The MIT License (MIT) +# +# Copyright (c) 2016 Scott Shawcroft for Adafruit Industries +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# This script builds the bundle + +set -e + +P=$( +ls -RUx | +gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(arr[0]) > 0 && match(arr[3], arr[2]) > 0) printf "%s, ", arr[3] }' | +gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }' +) + +circuitpython-build-bundles --filename_prefix circuitpython-community-bundle --library_location libraries --library_depth 2 --package_folder_prefix "$P" From bfa27d41f17f515de94c7d960a5df684b5d43c17 Mon Sep 17 00:00:00 2001 From: James Bowman Date: Fri, 12 Feb 2021 19:34:11 -0800 Subject: [PATCH 2/3] Copyright year --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3de5562..94ed85f 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ # The MIT License (MIT) # -# Copyright (c) 2016 Scott Shawcroft for Adafruit Industries +# Copyright (c) 2021 Scott Shawcroft for Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal From 218b2b4bb5fabb5e86a88a0e470d9b0bd2bbad6b Mon Sep 17 00:00:00 2001 From: James Bowman Date: Tue, 16 Feb 2021 15:07:56 -0800 Subject: [PATCH 3/3] Update the CI script to use build.sh --- .github/workflows/build.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39e7822..ccd80da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,14 +10,6 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - name: Set up Python 3.6 uses: actions/setup-python@v1 with: @@ -34,13 +26,5 @@ jobs: pip install -r requirements.txt - name: Library version run: git describe --dirty --always --tags - - name: Package Folder Prefix For circuitpython-build-tools (Community Bundle Specific) - id: pkg-folder - run: | - echo ::set-output name=prefix::$( - ls -RUx | - gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(arr[0]) > 0 && match(arr[3], arr[2]) > 0) printf "%s, ", arr[3] }' | - gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }' - ) - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location libraries --library_depth 2 --package_folder_prefix ${{ steps.pkg-folder.outputs.prefix }} + run: ./build.sh