Skip to content

Commit c908667

Browse files
Add necessary content for circup packaging
1 parent f4403a1 commit c908667

File tree

6 files changed

+137
-0
lines changed

6 files changed

+137
-0
lines changed

.github/workflows/build.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build CI
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Set up Python 3
10+
uses: actions/setup-python@v4
11+
with:
12+
python-version: 3.x
13+
- name: Versions
14+
run: |
15+
python3 --version
16+
- uses: actions/checkout@v3
17+
with:
18+
submodules: true
19+
- name: Fetch correct submodule shas
20+
run: git submodule foreach 'git fetch --tags --depth 1 origin $sha1 && git checkout -q $sha1'
21+
- name: Install deps
22+
run: |
23+
sudo apt-get install -y gettext gawk
24+
pip install -r requirements.txt
25+
- name: Library version
26+
run: git describe --dirty --always --tags
27+
- name: Build assets
28+
run: ./build.sh

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release Actions
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload-release-assets:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Translate Repo Name For Build Tools filename_prefix
12+
id: repo-name
13+
run: |
14+
echo "repo-name=$(
15+
echo ${{ github.repository }} |
16+
awk -F '\/' '{ print tolower($2) }' |
17+
tr '_' '-'
18+
)" >> $GITHUB_OUTPUT
19+
- name: Set up Python 3
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.x
23+
- name: Versions
24+
run: |
25+
python3 --version
26+
- uses: actions/checkout@v3
27+
with:
28+
submodules: true
29+
- name: Fetch correct submodule shas
30+
run: git submodule foreach 'git fetch --tags --depth 1 origin $sha1 && git checkout -q $sha1'
31+
- name: Install deps
32+
run: |
33+
sudo apt-get install -y gettext gawk
34+
pip install -r requirements.txt
35+
- name: Build assets
36+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location qwiic/drivers --library_depth 1 --package_folder_prefix "Qwiic, qwiic, Pi"
37+
- name: Upload Release Assets
38+
uses: shogo82148/actions-upload-release-asset@v1
39+
with:
40+
asset_path: "bundles/*"
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
upload_url: ${{ github.event.release.upload_url }}

README.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This README pertains to the CircuitPython bundle generated by the SparkFun Qwiic_Py repository.
2+
3+
4+
TODO: flesh out circuitpython details

build.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
# This script gets executed in "test" steps for non-release builds. See the "Build assets" step in release.yml for the build of actual release artifacts
30+
# Gather the package submods that are supported in CircuitPython and create a comma-separated string to pass to circuitpython-build-bundles
31+
# CIRCUP_DIRS="$(paste -sd ',' circuitpython_support.txt | sed 's/,/, /g')"
32+
# echo "FOUND CIRCUP DIRS: ${CIRCUP_DIRS}"
33+
circuitpython-build-bundles --filename_prefix qwiic-py --library_location qwiic/drivers --library_depth 1 --package_folder_prefix "Qwiic, qwiic, Pi"

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
circuitpython-build-tools
2+
setuptools

update-submodules.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /bin/bash
2+
3+
# The MIT License (MIT)
4+
#
5+
# Copyright (c) 2016 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 updates all submodules to the latest tag (hopefully release).
26+
git submodule update
27+
git submodule foreach git fetch
28+
git submodule foreach "tag=\$(git rev-list --tags --max-count=1); git checkout -q \$tag"

0 commit comments

Comments
 (0)