Update .gitea/workflows/build.yaml
This commit is contained in:
parent
aac041d54d
commit
7e08dc84a0
@ -1,84 +1,46 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
name: Build
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-left:
|
build-left:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: zmkfirmware/zmk-build-arm:stable
|
image: zmkfirmware/zmk-build-arm:stable
|
||||||
name: Build left
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Dependencies
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
apt-get update;
|
apt-get update;
|
||||||
apt-get install --yes --no-install-recommends \
|
apt-get install --yes --no-install-recommends nodejs zstd zip
|
||||||
nodejs \
|
- name: Checkout code
|
||||||
zstd \
|
|
||||||
zip
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Compute hash for west modules
|
||||||
- name: Hash west modules
|
|
||||||
id: hash-west
|
id: hash-west
|
||||||
run: |
|
run: |
|
||||||
FILE_PATH=zephyr/west.yml
|
HASH=$(find . -name 'build.yml' -o -name 'west.yml' -exec sha256sum {} \; | sort | sha256sum | head -c 64)
|
||||||
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
|
|
||||||
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
|
|
||||||
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
||||||
echo "computed hash: $HASH"
|
|
||||||
|
|
||||||
- name: Cache west modules
|
- name: Cache west modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
env:
|
|
||||||
cache-name: cache-zephyr-modules
|
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
modules/
|
modules/
|
||||||
tools/
|
tools/
|
||||||
zephyr/
|
zephyr/
|
||||||
bootloader/
|
bootloader/
|
||||||
key: ${{ runner.os }}-build-left-${{ env.cache-name }}-${{ steps.hash-west.outputs.hash }}
|
key: ${{ runner.os }}-build-left-${{ steps.hash-west.outputs.hash }}
|
||||||
restore-keys: |
|
- name: Initialize and update West
|
||||||
${{ runner.os }}-build-left-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-build-left-
|
|
||||||
${{ runner.os }}-
|
|
||||||
timeout-minutes: 5
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: West Init
|
|
||||||
run: west init -l config
|
|
||||||
|
|
||||||
- name: West Update
|
|
||||||
run: west update
|
|
||||||
|
|
||||||
- name: West Zephyr export
|
|
||||||
run: west zephyr-export
|
|
||||||
|
|
||||||
- name: West Build (Ferris Left)
|
|
||||||
run: west build -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_left -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
|
||||||
|
|
||||||
- name: Ferris Left Kconfig file
|
|
||||||
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
|
|
||||||
|
|
||||||
- name: Rename zmk.uf2
|
|
||||||
run: cp build/zephyr/zmk.uf2 cradio_left_nice_nano_v2.uf2
|
|
||||||
|
|
||||||
- name: Hash west modules
|
|
||||||
id: hash-west
|
|
||||||
run: |
|
run: |
|
||||||
FILE_PATH=zephyr/west.yml
|
west init -l config
|
||||||
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
|
west update
|
||||||
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
|
west zephyr-export
|
||||||
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
- name: Build Firmware (Left)
|
||||||
echo "computed hash: $HASH"
|
run: west build -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_left -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
||||||
|
- name: Rename and upload artifact (Left)
|
||||||
- name: Upload Artifact (Left)
|
run: mv build/zephyr/zmk.uf2 cradio_left_nice_nano_v2.uf2
|
||||||
uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: cradio_left_nice_nano_v2.uf2
|
path: cradio_left_nice_nano_v2.uf2
|
||||||
name: left
|
name: left
|
||||||
@ -87,123 +49,63 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: zmkfirmware/zmk-build-arm:stable
|
image: zmkfirmware/zmk-build-arm:stable
|
||||||
name: Build right
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Dependencies
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
apt-get update;
|
apt-get update;
|
||||||
apt-get install --yes --no-install-recommends \
|
apt-get install --yes --no-install-recommends nodejs zstd zip
|
||||||
nodejs \
|
- name: Checkout code
|
||||||
zstd \
|
|
||||||
zip
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Compute hash for west modules
|
||||||
- name: Hash west modules
|
|
||||||
id: hash-west
|
id: hash-west
|
||||||
run: |
|
run: |
|
||||||
FILE_PATH=zephyr/west.yml
|
HASH=$(find . -name 'build.yml' -o -name 'west.yml' -exec sha256sum {} \; | sort | sha256sum | head -c 64)
|
||||||
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
|
|
||||||
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
|
|
||||||
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
||||||
echo "computed hash: $HASH"
|
|
||||||
|
|
||||||
- name: Cache west modules
|
- name: Cache west modules
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
env:
|
|
||||||
cache-name: cache-zephyr-modules
|
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
modules/
|
modules/
|
||||||
tools/
|
tools/
|
||||||
zephyr/
|
zephyr/
|
||||||
bootloader/
|
bootloader/
|
||||||
key: ${{ runner.os }}-build-left-${{ env.cache-name }}-${{ steps.hash-west.outputs.hash }}
|
key: ${{ runner.os }}-build-right-${{ steps.hash-west.outputs.hash }}
|
||||||
restore-keys: |
|
- name: Initialize and update West
|
||||||
${{ runner.os }}-build-left-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-build-left-
|
|
||||||
${{ runner.os }}-
|
|
||||||
timeout-minutes: 5
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: West Init
|
|
||||||
run: west init -l config
|
|
||||||
|
|
||||||
- name: West Update
|
|
||||||
run: west update
|
|
||||||
|
|
||||||
- name: West Zephyr export
|
|
||||||
run: west zephyr-export
|
|
||||||
|
|
||||||
- name: West Build (Ferris Right)
|
|
||||||
run: west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_right -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
|
|
||||||
|
|
||||||
- name: Ferris Right Kconfig file
|
|
||||||
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
|
|
||||||
|
|
||||||
- name: Rename zmk.uf2
|
|
||||||
run: cp build/zephyr/zmk.uf2 cradio_right_nice_nano_v2.uf2
|
|
||||||
|
|
||||||
- name: Hash west modules
|
|
||||||
id: hash-west
|
|
||||||
run: |
|
run: |
|
||||||
FILE_PATH=zephyr/west.yml
|
west init -l config
|
||||||
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
|
west update
|
||||||
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
|
west zephyr-export
|
||||||
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
- name: Build Firmware (Right)
|
||||||
echo "computed hash: $HASH"
|
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)
|
||||||
- name: Upload Artifact
|
run: mv build/zephyr/zmk.uf2 cradio_right_nice_nano_v2.uf2
|
||||||
uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: cradio_right_nice_nano_v2.uf2
|
path: cradio_right_nice_nano_v2.uf2
|
||||||
name: right
|
name: right
|
||||||
|
|
||||||
build:
|
combine:
|
||||||
needs:
|
needs:
|
||||||
- build-left
|
- build-left
|
||||||
- build-right
|
- build-right
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: zmkfirmware/zmk-build-arm:stable
|
image: zmkfirmware/zmk-build-arm:stable
|
||||||
name: Build
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Dependencies
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
apt-get update;
|
apt-get update;
|
||||||
apt-get install --yes --no-install-recommends \
|
apt-get install --yes --no-install-recommends nodejs zip
|
||||||
nodejs \
|
- name: Download artifacts
|
||||||
zip
|
|
||||||
|
|
||||||
- name: Download artifact (right)
|
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: cradio_right_nice_nano_v2.uf2
|
|
||||||
name: right
|
|
||||||
|
|
||||||
- name: Download artifact (left)
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
path: cradio_left_nice_nano_v2.uf2
|
|
||||||
name: left
|
name: left
|
||||||
|
path: firmware/
|
||||||
- name: Move artifacts
|
- uses: actions/download-artifact@v3
|
||||||
run: |
|
with:
|
||||||
mkdir firmware
|
name: right
|
||||||
mv cradio_left_nice_nano_v2.uf2 firmware/
|
path: firmware/
|
||||||
mv cradio_right_nice_nano_v2.uf2 firmware/
|
- name: Upload combined firmware artifacts
|
||||||
|
|
||||||
- name: Hash west modules
|
|
||||||
id: hash-west
|
|
||||||
run: |
|
|
||||||
FILE_PATH=zephyr/west.yml
|
|
||||||
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
|
|
||||||
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
|
|
||||||
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "computed hash: $HASH"
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: firmware/
|
path: firmware/
|
||||||
|
Loading…
Reference in New Issue
Block a user