zmk-config/.gitea/workflows/build.yaml

97 lines
2.8 KiB
YAML
Raw Normal View History

2024-08-15 07:21:17 +00:00
on:
push:
branches:
- main
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
name: Build
2024-08-15 06:49:07 +00:00
2024-08-09 17:20:17 +00:00
jobs:
build:
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
name: Build
2024-08-15 06:49:07 +00:00
steps:
2024-08-15 06:59:00 +00:00
- name: Install Dependencies
run: |
apt-get update;
apt-get install --yes --no-install-recommends \
nodejs \
zstd \
zip
2024-08-15 06:49:07 +00:00
- name: Checkout
[RENOVATE] Update actions/checkout action to v4 (#3) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v3` -> `v4` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v4`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v417) [Compare Source](https://github.com/actions/checkout/compare/v3...v4) - Bump the minor-npm-dependencies group across 1 directory with 4 updates by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/actions/checkout/pull/1739 - Bump actions/checkout from 3 to 4 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/actions/checkout/pull/1697 - Check out other refs/\* by commit by [@&#8203;orhantoy](https://github.com/orhantoy) in https://github.com/actions/checkout/pull/1774 - Pin actions/checkout's own workflows to a known, good, stable version. by [@&#8203;jww3](https://github.com/jww3) in https://github.com/actions/checkout/pull/1776 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4zMi4xIiwidXBkYXRlZEluVmVyIjoiMzguMzIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.kjan.de/jank/zmk-config/pulls/3 Co-authored-by: Renovate <renovate@kjan.de> Co-committed-by: Renovate <renovate@kjan.de>
2024-08-15 07:28:36 +00:00
uses: actions/checkout@v4
2024-08-15 06:59:00 +00:00
- 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"
2024-08-15 06:49:07 +00:00
- name: Cache west modules
uses: actions/cache@v4
2024-08-15 06:49:07 +00:00
env:
cache-name: cache-zephyr-modules
with:
path: |
modules/
tools/
zephyr/
2024-08-15 06:59:00 +00:00
bootloader/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ steps.hash-west.outputs.hash }}
2024-08-15 06:49:07 +00:00
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
2024-08-15 06:59:00 +00:00
${{ runner.os }}-
timeout-minutes: 5
2024-08-15 06:49:07 +00:00
continue-on-error: true
2024-08-15 06:59:00 +00:00
- name: West Init
run: west init -l config
- name: West Update
run: west update
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
- name: West Zephyr export
run: west zephyr-export
2024-08-15 06:49:07 +00:00
2024-08-15 07:13:22 +00:00
- name: West Build (Ferris Left)
run: west build -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_left -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
2024-08-15 06:49:07 +00:00
2024-08-15 07:13:22 +00:00
- name: Ferris Left Kconfig file
2024-08-15 06:59:00 +00:00
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
- name: Rename zmk.uf2
2024-08-15 07:13:22 +00:00
run: cp build/zephyr/zmk.uf2 cradio_left_nice_nano_v2.uf2
2024-08-15 06:49:07 +00:00
2024-08-15 07:13:22 +00:00
- name: West Build (Ferris Right)
run: west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_right -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
2024-08-15 06:49:07 +00:00
2024-08-15 07:13:22 +00:00
- name: Ferris Right Kconfig file
2024-08-15 06:59:00 +00:00
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
- name: Rename zmk.uf2
2024-08-15 07:13:22 +00:00
run: cp build/zephyr/zmk.uf2 cradio_right_nice_nano_v2.uf2
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
- name: Zip Artifacts
2024-08-15 07:13:22 +00:00
run: zip firmware.zip cradio_left_nice_nano_v2.uf2 cradio_right_nice_nano_v2.uf2
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
- 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"
2024-08-15 06:49:07 +00:00
2024-08-15 06:59:00 +00:00
- name: Upload Artifact
uses: actions/upload-artifact@v3
2024-08-15 06:49:07 +00:00
with:
2024-08-15 06:59:00 +00:00
path: firmware.zip
name: firmware.zip