Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ jobs:
run: |
sudo apt-get install -y gettext gawk
pip install -r requirements.txt
- name: Package Folder Prefix For circuitpython-build-tools (Community Bundle Specific)
id: pkg-folder
- name: Build assets
env:
FILENAME_PREFIX: ${{ steps.repo-name.outputs.repo-name }}
run: |
echo prefix=$(
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 "\"" }'
) >> $GITHUB_OUTPUT
- 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 }}
gawk '{ print substr($0, 1, length($0) - 2) }'
)
if [ -z "$prefix" ]; then
echo "::error::no package folders matched under libraries/"
exit 1
fi
circuitpython-build-bundles --filename_prefix "$FILENAME_PREFIX" --library_location libraries --library_depth 2 --package_folder_prefix "$prefix"
- name: Upload Release Assets
uses: shogo82148/actions-upload-release-asset@v1
with:
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ 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 "\"" }'
gawk '{ print substr($0, 1, length($0) - 2) }'
)

if [ -z "$P" ]; then
echo "error: no package folders matched under libraries/" >&2
exit 1
fi

circuitpython-build-bundles --filename_prefix circuitpython-community-bundle --library_location libraries --library_depth 2 --package_folder_prefix "$P"