113 lines
3.4 KiB
YAML
113 lines
3.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-left:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: zmkfirmware/zmk-build-arm:stable
|
|
steps:
|
|
- name: Setup
|
|
run: |
|
|
apt-get update;
|
|
apt-get install --yes --no-install-recommends nodejs zstd zip
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Compute hash for west modules
|
|
id: hash-west
|
|
run: |
|
|
HASH=$(find . -name 'build.yml' -o -name 'west.yml' -exec sha256sum {} \; | sort | sha256sum | head -c 64)
|
|
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
|
- name: Cache west modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
modules/
|
|
tools/
|
|
zephyr/
|
|
bootloader/
|
|
key: ${{ runner.os }}-build-left-${{ steps.hash-west.outputs.hash }}
|
|
- name: Initialize and update West
|
|
run: |
|
|
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
|
|
with:
|
|
path: cradio_left_nice_nano_v2.uf2
|
|
name: left
|
|
|
|
build-right:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: zmkfirmware/zmk-build-arm:stable
|
|
steps:
|
|
- name: Setup
|
|
run: |
|
|
apt-get update;
|
|
apt-get install --yes --no-install-recommends nodejs zstd zip
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Compute hash for west modules
|
|
id: hash-west
|
|
run: |
|
|
HASH=$(find . -name 'build.yml' -o -name 'west.yml' -exec sha256sum {} \; | sort | sha256sum | head -c 64)
|
|
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
|
- name: Cache west modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
modules/
|
|
tools/
|
|
zephyr/
|
|
bootloader/
|
|
key: ${{ runner.os }}-build-right-${{ steps.hash-west.outputs.hash }}
|
|
- name: Initialize and update West
|
|
run: |
|
|
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
|
|
with:
|
|
path: cradio_right_nice_nano_v2.uf2
|
|
name: right
|
|
|
|
combine:
|
|
needs:
|
|
- build-left
|
|
- build-right
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: zmkfirmware/zmk-build-arm:stable
|
|
steps:
|
|
- name: Setup
|
|
run: |
|
|
apt-get update;
|
|
apt-get install --yes --no-install-recommends nodejs zip
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: left
|
|
path: firmware/
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: right
|
|
path: firmware/
|
|
- name: Upload combined firmware artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
path: firmware/
|
|
name: firmware
|