Skip to content

Commit 57a7361

Browse files
committed
Add RP2040 firmware build
1 parent 02e029e commit 57a7361

5 files changed

Lines changed: 70 additions & 21 deletions

File tree

.github/actions/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
FROM qmkfm/qmk_cli
22

33
COPY entrypoint.sh /entrypoint.sh
4-
ENTRYPOINT ["/entrypoint.sh"]
4+
ENTRYPOINT ["/entrypoint.sh"]
5+
6+
# NOTE: When building locally (from this directory):
7+
# pushd ../../../qmk_base_container && docker build -t "qmkfm/base_container:latest" . ; popd
8+
# pushd ../../../qmk_cli && docker build -t "qmkfm/qmk_cli:latest" . ; popd
9+
# docker build -t "nullbitsco/firmware:latest" . && docker run nullbitsco/firmware

.github/actions/entrypoint.sh

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,69 @@ GITHASH_STR="<b>Commits used to build this release:</b><br>"
55
append_githash_info () {
66
GITHASH=$(git rev-parse HEAD)
77
GITHASH_SHORT=$(echo "$GITHASH" | cut -c 1-7)
8-
GITNAME=$(basename `git rev-parse --show-toplevel`)
8+
GITNAME=$(basename "$(git rev-parse --show-toplevel)")
9+
[ -z "$1" ] || GITNAME=$1
910
GITURL=$(git config --get remote.origin.url)
1011
GITHASH_STR="$GITHASH_STR $GITNAME: [$GITHASH_SHORT]($GITURL/commit/$GITHASH)<br>"
1112
}
1213

1314
git clone --no-checkout https://github.com/qmk/qmk_firmware --depth 1
1415

15-
cd qmk_firmware
16-
16+
cd qmk_firmware || exit 1
1717
git config core.sparsecheckout true
1818
echo '/*\n!/keyboards\n/keyboards/nullbitsco/*\n' > .git/info/sparse-checkout
1919
git checkout --
2020

2121
append_githash_info
2222

23-
cd keyboards/nullbitsco
23+
# Add tidbit extras repo
24+
cd keyboards/nullbitsco || exit 1
2425
git submodule add https://github.com/nullbitsco/tidbit tidbit_extras
25-
ln -s $(realpath .)/tidbit_extras/keymaps/* tidbit/keymaps
26+
ln -s "$(realpath .)/tidbit_extras/keymaps/*" tidbit/keymaps
2627

27-
cd tidbit_extras
28+
cd tidbit_extras || exit 1
2829
append_githash_info
2930
cd ../
3031

32+
# Add snap repo
3133
git submodule add https://github.com/nullbitsco/snap snap
32-
33-
cd snap
34+
cd snap || exit 1
3435
append_githash_info
3536
cd ../
3637

37-
echo "::set-output name=commits::$GITHASH_STR"
38+
qmk setup -y
39+
40+
# Compile for AVR
41+
for t in nibble tidbit scramble snap;
42+
do echo "Building QMK for $t";
43+
qmk compile -j 2 -kb nullbitsco/$t -km all
44+
done
45+
46+
# Checkout nullbits rp2040 repo
47+
git config advice.detachedHead false
48+
git remote add nullbits https://github.com/jaygreco/qmk_firmware.git
49+
git fetch nullbits --depth=1 2> /dev/null
50+
git checkout nullbits/rp2040_clean
3851

52+
append_githash_info "qmk_firmware rp2040"
53+
54+
# Update submodules after repo switch, but before checking out rp2040 SNAP
3955
cd ../../
56+
make git-submodule
4057

41-
qmk setup -y
58+
# Checkout nullbits rp2040 snap repo
59+
cd keyboards/nullbitsco/snap || exit 1
60+
git checkout rp2040_clean
61+
append_githash_info "snap rp2040"
62+
cd ../../../
63+
64+
# Compile for RP2040
65+
for t in nibble/rp2040 tidbit/rp2040 scramble/v2 snap/rp2040;
66+
do echo "Building QMK for $t";
67+
qmk compile -j 2 -kb nullbitsco/$t -km all
68+
done
69+
70+
echo "::set-output name=commits::$GITHASH_STR"
4271

43-
make all
72+
ls *.hex
73+
ls *.uf2

.github/workflows/build-fw.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
name: precompiled-firmware-files
2727
path: |
2828
qmk_firmware/nullbitsco_*.hex
29+
qmk_firmware/nullbitsco_*.uf2
2930
- name: Get current date
3031
id: date
3132
run: echo "::set-output name=date::$(date +'%m/%d/%Y')"
@@ -36,13 +37,25 @@ jobs:
3637
These files are always the most up-to-date but may contain unfixed bugs or other unreported issues!
3738
**It is highly recommended that you flash one of the [official releases](https://github.com/nullbitsco/firmware/releases/tag/latest) instead.**
3839
<br><br>${{ steps.docker_build.outputs.commits }}')"
39-
- name: Create release
40+
- name: Create release (AVR)
4041
uses: ncipollo/release-action@v1
4142
with:
4243
artifacts: "qmk_firmware/nullbitsco_*.hex"
4344
allowUpdates: true
4445
artifactErrorsFailBuild: true
4546
body: ${{ steps.release_text.outputs.release_text }}
46-
tag: "nightly"
47-
name: "Nightly Build ${{ steps.date.outputs.date }}"
48-
token: ${{ secrets.GITHUB_TOKEN }}
47+
tag: "nightly-avr"
48+
name: "Nightly AVR Build ${{ steps.date.outputs.date }}"
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
removeArtifacts: true
51+
- name: Create release (RP2040)
52+
uses: ncipollo/release-action@v1
53+
with:
54+
artifacts: "qmk_firmware/nullbitsco_*.uf2"
55+
allowUpdates: true
56+
artifactErrorsFailBuild: true
57+
body: ${{ steps.release_text.outputs.release_text }}
58+
tag: "nightly-rp2040"
59+
name: "Nightly RP2040 Build ${{ steps.date.outputs.date }}"
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
removeArtifacts: true

.github/workflows/release-fw.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
description: 'Additional release text'
88
default: ""
99

10-
#TODO: split jobs!
1110
jobs:
1211
build:
1312
runs-on: ubuntu-latest
@@ -45,3 +44,5 @@ jobs:
4544
tag: "latest"
4645
name: "Precompiled Firmware Files"
4746
token: ${{ secrets.GITHUB_TOKEN }}
47+
removeArtifacts: true
48+
makeLatest: true

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For use with [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases). Follow
66

77
### Looking for the source code instead?
88
For those who want to compile along at home.
9-
[SNAP](https://github.com/nullbitsco/snap)
10-
[NIBBLE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nullbitsco/nibble)
11-
[TIDBIT](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nullbitsco/tidbit) [+Extras](https://github.com/nullbitsco/tidbit)
12-
[SCRAMBLE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nullbitsco/scramble)
9+
[SNAP](https://github.com/nullbitsco/snap) [+RP2040](https://github.com/nullbitsco/snap/tree/rp2040_clean)
10+
[NIBBLE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nullbitsco/nibble) [+RP2040](https://github.com/jaygreco/qmk_firmware/tree/rp2040_clean/keyboards/nullbitsco/nibble)
11+
[TIDBIT](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nullbitsco/tidbit) [+Extras](https://github.com/nullbitsco/tidbit) [+RP2040](https://github.com/jaygreco/qmk_firmware/tree/rp2040_clean/keyboards/nullbitsco/tidbit)
12+
[SCRAMBLE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/nullbitsco/scramble) [+RP2040](https://github.com/jaygreco/qmk_firmware/tree/rp2040_clean/keyboards/nullbitsco/scramble)

0 commit comments

Comments
 (0)