Skip to content

Commit 738ec66

Browse files
authored
Merge pull request #56 from jamesbowman/master
New script build.sh builds packages
2 parents 85db39d + 218b2b4 commit 738ec66

File tree

3 files changed

+37
-18
lines changed

3 files changed

+37
-18
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ jobs:
1010
env:
1111
GITHUB_CONTEXT: ${{ toJson(github) }}
1212
run: echo "$GITHUB_CONTEXT"
13-
- name: Translate Repo Name For Build Tools filename_prefix
14-
id: repo-name
15-
run: |
16-
echo ::set-output name=repo-name::$(
17-
echo ${{ github.repository }} |
18-
awk -F '\/' '{ print tolower($2) }' |
19-
tr '_' '-'
20-
)
2113
- name: Set up Python 3.6
2214
uses: actions/setup-python@v1
2315
with:
@@ -34,13 +26,5 @@ jobs:
3426
pip install -r requirements.txt
3527
- name: Library version
3628
run: git describe --dirty --always --tags
37-
- name: Package Folder Prefix For circuitpython-build-tools (Community Bundle Specific)
38-
id: pkg-folder
39-
run: |
40-
echo ::set-output name=prefix::$(
41-
ls -RUx |
42-
gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(arr[0]) > 0 && match(arr[3], arr[2]) > 0) printf "%s, ", arr[3] }' |
43-
gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }'
44-
)
4529
- name: Build assets
46-
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 }}
30+
run: ./build.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ Once installed, make sure you are in the virtual environment:
6060

6161
Then run the build:
6262

63-
circuitpython-build-bundles --filename_prefix circuitpython-community-bundle --library_location libraries --library_depth 2
63+
./build.sh

build.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! /bin/bash
2+
3+
# The MIT License (MIT)
4+
#
5+
# Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
# THE SOFTWARE.
24+
25+
# This script builds the bundle
26+
27+
set -e
28+
29+
P=$(
30+
ls -RUx |
31+
gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(arr[0]) > 0 && match(arr[3], arr[2]) > 0) printf "%s, ", arr[3] }' |
32+
gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }'
33+
)
34+
35+
circuitpython-build-bundles --filename_prefix circuitpython-community-bundle --library_location libraries --library_depth 2 --package_folder_prefix "$P"

0 commit comments

Comments
 (0)