Update ardux.dtsi #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: zmkfirmware/zmk-build-arm:stable | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- board: nice_nano_v2 | |
shield: cradio_ardux_left | |
- board: nice_nano_v2 | |
shield: cradio_ardux_thumb_left | |
- board: nice_nano_v2 | |
shield: cradio_ardux_right | |
- board: nice_nano_v2 | |
shield: cradio_ardux_thumb_right | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache west modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-zephyr-modules | |
with: | |
path: | | |
bootloader/ | |
modules/ | |
tools/ | |
zephyr/ | |
zmk/ | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('config/west.yml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
timeout-minutes: 2 | |
continue-on-error: true | |
- name: Initialize workspace (west init) | |
run: west init -l config | |
- name: Update modules (west update) | |
run: west update | |
- name: Export Zephyr CMake package (west zephyr-export) | |
run: west zephyr-export | |
- name: Prepare variables | |
id: variables | |
run: | | |
if [ -n "${{ matrix.shield }}" ]; then | |
SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" | |
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux" | |
else | |
SHIELD_ARG= | |
ARTIFACT_NAME="${{ matrix.board }}-zmk-ardux" | |
fi | |
echo shield-arg=${SHIELD_ARG} >>$GITHUB_OUTPUT | |
echo artifact-name=${ARTIFACT_NAME} >>$GITHUB_OUTPUT | |
- name: Build (west build) | |
run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" | |
- name: ARDUX implementation dtsi file | |
if: always() | |
run: cat -n config/ardux.dtsi | |
- name: Prep artifact (ardux.dtsi) | |
run: cp config/ardux.dtsi ./ardux.dtsi | |
- name: Prep artifact (${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux.hex) | |
run: cp build/zephyr/zmk.hex ${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux.hex | |
- name: Prep artifact (${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux.uf2) | |
run: cp build/zephyr/zmk.uf2 ${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux.uf2 | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ steps.variables.outputs.artifact-name }}' | |
path: | | |
ardux.dtsi | |
${{ matrix.shield }}-${{ matrix.board }}.dts.pre.tmp | |
${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux.hex | |
${{ matrix.shield }}-${{ matrix.board }}-zmk-ardux.uf2 | |
continue-on-error: true | |
release: | |
runs-on: ubuntu-latest | |
name: Create Release | |
needs: build | |
steps: | |
- name: Get current date/time | |
id: date | |
run: echo "date=$(date +'%Y%m%d-%H%M')" >>$GITHUB_OUTPUT | |
- name: Generate release text | |
id: release_text | |
run: > | |
echo "release_text=$(echo '<b>Precompiled firmware files for ARDUX</b><br><br> | |
Download a firmware file by expanding "Assets", right clicking, and choosing "Save File As" or "Save Link As". | |
<br>${{ github.event.inputs.releaseBody }} | |
<br>Released on ${{ steps.date.outputs.date }}. | |
<br><br>${{ steps.docker_build.outputs.commits }}')" >>$GITHUB_OUTPUT | |
- name: Download build artifacts for release | |
uses: actions/download-artifact@v4 | |
with: | |
path: release | |
- name: List files to include in release | |
if: always() | |
run: ls -R release/ | |
- name: Create zip files directory for individual board assets | |
if: always() | |
run: mkdir zips | |
- name: Zip all firmware files for release | |
if: always() | |
run: cd release && for folder in ./*; do echo $folder; zip -r ../zips/${folder}.zip ${folder}/; done && cd .. | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "zips/*" | |
allowUpdates: false | |
artifactErrorsFailBuild: true | |
commit: main | |
tag: ${{ steps.date.outputs.date }} | |
body: ${{ steps.release_text.outputs.release_text }} | |
name: ${{ steps.date.outputs.date }} | |
token: ${{ secrets.GITHUB_TOKEN }} |