Converting target configuration to JSON file

- added json file with copy targets
- added a bunch of steps to load/parse hte json file
- altered my copy command to loop through array
This commit is contained in:
Victor 2024-04-10 20:27:28 -05:00
parent b30815e11c
commit 271fdd4668
Failed to generate hash of commit
4 changed files with 21 additions and 6 deletions

View file

@ -1,3 +0,0 @@
keyboard:
- 'barbellboards'
- 'planck'

View file

@ -12,7 +12,6 @@ jobs:
with:
qmk_repo: qmk/qmk_firmware
qmk_ref: master
config-file: ./.github/workflows/Configuration/keyboard_nontree.yaml
publish:
name: 'QMK Userspace Publish'

View file

@ -61,10 +61,23 @@ jobs:
run: |
qmk userspace-doctor
- name: Install jq
run: sudo apt-get install jq
- name: Import Non Tree Targets JSON file
id: read_file
run: cat $GITHUB_WORKSPACE/qmk-nontree.json
- name: Parse Non Tree Targets JSON file
id: parse-json
run: echo "${{ steps.read_file.outputs.stdout }}" | jq -r '.nontree_targets[]'
- name: Copy Non-Tree Keyboards to QMK Firmware
id: loop-targets
run: |
for kb in '${keyboard[@]}'; do
cp $GITHUB_WORKSPACE/keyboards/$kb $GITHUB_WORKSPACE/qmk_firmware/keyboards -R
for target in ${{ steps.parse-json.outputs.stdout }};
do
cp $GITHUB_WORKSPACE/keyboards/$target $GITHUB_WORKSPACE/qmk_firmware/keyboards -R
done
- name: Build

6
qmk_nontree.json Normal file
View file

@ -0,0 +1,6 @@
{
"nontree_targets": [
"barbellboards",
"planck"
]
}