2024-08-16 10:03:13 +00:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
2024-08-15 07:21:17 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-08-15 06:49:07 +00:00
|
|
|
|
2024-08-09 17:20:17 +00:00
|
|
|
jobs:
|
2024-08-16 09:28:21 +00:00
|
|
|
build-left:
|
2024-08-15 06:49:07 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2024-08-15 06:59:00 +00:00
|
|
|
image: zmkfirmware/zmk-build-arm:stable
|
2024-08-15 06:49:07 +00:00
|
|
|
steps:
|
2024-08-16 10:03:13 +00:00
|
|
|
- name: Setup
|
2024-08-15 06:59:00 +00:00
|
|
|
run: |
|
|
|
|
apt-get update;
|
2024-08-16 10:03:13 +00:00
|
|
|
apt-get install --yes --no-install-recommends nodejs zstd zip
|
|
|
|
- name: Checkout code
|
2024-08-15 07:28:36 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-08-16 10:03:13 +00:00
|
|
|
- name: Compute hash for west modules
|
2024-08-15 06:59:00 +00:00
|
|
|
id: hash-west
|
|
|
|
run: |
|
2024-08-16 10:03:13 +00:00
|
|
|
HASH=$(find . -name 'build.yml' -o -name 'west.yml' -exec sha256sum {} \; | sort | sha256sum | head -c 64)
|
2024-08-15 06:59:00 +00:00
|
|
|
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
2024-08-15 06:49:07 +00:00
|
|
|
- name: Cache west modules
|
2024-08-15 07:29:47 +00:00
|
|
|
uses: actions/cache@v4
|
2024-08-15 06:49:07 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
modules/
|
|
|
|
tools/
|
|
|
|
zephyr/
|
2024-08-16 10:03:13 +00:00
|
|
|
bootloader/
|
|
|
|
key: ${{ runner.os }}-build-left-${{ steps.hash-west.outputs.hash }}
|
|
|
|
- name: Initialize and update West
|
2024-08-16 09:28:21 +00:00
|
|
|
run: |
|
2024-08-16 10:03:13 +00:00
|
|
|
west init -l config
|
|
|
|
west update
|
|
|
|
west zephyr-export
|
|
|
|
- name: Build Firmware (Left)
|
|
|
|
run: west build -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_left -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
|
|
|
- name: Rename and upload artifact (Left)
|
|
|
|
run: mv build/zephyr/zmk.uf2 cradio_left_nice_nano_v2.uf2
|
|
|
|
- uses: actions/upload-artifact@v3
|
2024-08-16 09:28:21 +00:00
|
|
|
with:
|
|
|
|
path: cradio_left_nice_nano_v2.uf2
|
|
|
|
name: left
|
|
|
|
|
|
|
|
build-right:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: zmkfirmware/zmk-build-arm:stable
|
|
|
|
steps:
|
2024-08-16 10:03:13 +00:00
|
|
|
- name: Setup
|
2024-08-16 09:28:21 +00:00
|
|
|
run: |
|
|
|
|
apt-get update;
|
2024-08-16 10:03:13 +00:00
|
|
|
apt-get install --yes --no-install-recommends nodejs zstd zip
|
|
|
|
- name: Checkout code
|
2024-08-16 09:28:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-08-16 10:03:13 +00:00
|
|
|
- name: Compute hash for west modules
|
2024-08-16 09:28:21 +00:00
|
|
|
id: hash-west
|
|
|
|
run: |
|
2024-08-16 10:03:13 +00:00
|
|
|
HASH=$(find . -name 'build.yml' -o -name 'west.yml' -exec sha256sum {} \; | sort | sha256sum | head -c 64)
|
2024-08-16 09:28:21 +00:00
|
|
|
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Cache west modules
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
modules/
|
|
|
|
tools/
|
|
|
|
zephyr/
|
2024-08-16 10:03:13 +00:00
|
|
|
bootloader/
|
|
|
|
key: ${{ runner.os }}-build-right-${{ steps.hash-west.outputs.hash }}
|
|
|
|
- name: Initialize and update West
|
2024-08-16 09:28:21 +00:00
|
|
|
run: |
|
2024-08-16 10:03:13 +00:00
|
|
|
west init -l config
|
|
|
|
west update
|
|
|
|
west zephyr-export
|
|
|
|
- name: Build Firmware (Right)
|
|
|
|
run: west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_right -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
|
|
|
- name: Rename and upload artifact (Right)
|
|
|
|
run: mv build/zephyr/zmk.uf2 cradio_right_nice_nano_v2.uf2
|
|
|
|
- uses: actions/upload-artifact@v3
|
2024-08-16 09:28:21 +00:00
|
|
|
with:
|
|
|
|
path: cradio_right_nice_nano_v2.uf2
|
|
|
|
name: right
|
|
|
|
|
2024-08-16 10:03:13 +00:00
|
|
|
combine:
|
2024-08-16 09:28:21 +00:00
|
|
|
needs:
|
|
|
|
- build-left
|
|
|
|
- build-right
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: zmkfirmware/zmk-build-arm:stable
|
|
|
|
steps:
|
2024-08-16 10:03:13 +00:00
|
|
|
- name: Setup
|
2024-08-16 09:28:21 +00:00
|
|
|
run: |
|
|
|
|
apt-get update;
|
2024-08-16 10:03:13 +00:00
|
|
|
apt-get install --yes --no-install-recommends nodejs zip
|
|
|
|
- name: Download artifacts
|
2024-08-16 09:32:01 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2024-08-16 09:28:21 +00:00
|
|
|
with:
|
|
|
|
name: left
|
2024-08-16 10:03:13 +00:00
|
|
|
path: firmware/
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: right
|
|
|
|
path: firmware/
|
|
|
|
- name: Upload combined firmware artifacts
|
2024-08-15 06:59:00 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2024-08-15 06:49:07 +00:00
|
|
|
with:
|
2024-08-16 06:25:16 +00:00
|
|
|
path: firmware/
|
|
|
|
name: firmware
|