From 92cf5189a31caf902459255dd18539382b9babbe Mon Sep 17 00:00:00 2001 From: kB01 Date: Thu, 9 Jan 2025 22:48:08 +0100 Subject: [PATCH] Updated Workflow for use on Forgejo --- .github/workflows/build-user-config.yml | 21 ++++++++---- .github/workflows/build.yml | 45 ++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-user-config.yml b/.github/workflows/build-user-config.yml index e1e67f4..591fe8a 100644 --- a/.github/workflows/build-user-config.yml +++ b/.github/workflows/build-user-config.yml @@ -32,7 +32,12 @@ jobs: build_matrix: ${{ env.build_matrix }} steps: - name: Checkout - uses: actions/checkout@v4 + run: printf "/home/runner/externals/node20/bin\n" >> $GITHUB_PATH + - uses: actions/checkout@v4 + + - name: Install Dependencies + run: apt-get update + - run: apt-get -y install python3-pip jq - name: Install yaml2json run: python3 -m pip install remarshal @@ -53,7 +58,8 @@ jobs: matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }} steps: - name: Checkout - uses: actions/checkout@v4 + run: printf "/home/runner/externals/node20/bin\n" >> $GITHUB_PATH + - uses: actions/checkout@v4 - name: Create build directory run: | @@ -94,7 +100,8 @@ jobs: fi - name: Cache west modules - uses: actions/cache@v4 + run: printf "/home/runner/externals/node20/bin\n" >> $GITHUB_PATH + - uses: actions/cache@v4 continue-on-error: true env: cache_name: cache-zephyr-${{ env.zephyr_version }}-modules @@ -164,7 +171,8 @@ jobs: fi - name: Archive (${{ env.display_name }}) - uses: actions/upload-artifact@v3 + run: printf "/home/runner/externals/node20/bin\n" >> $GITHUB_PATH + - uses: actions/upload-artifact@v3 with: name: artifact-${{ env.artifact_name }} path: ${{ env.build_dir }}/artifacts @@ -175,8 +183,9 @@ jobs: name: Merge Output Artifacts steps: - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + run: printf "/home/runner/externals/node20/bin\n" >> $GITHUB_PATH + - uses: actions/upload-artifact/merge@v4 with: name: ${{ inputs.archive_name }} pattern: artifact-* - delete-merged: true \ No newline at end of file + delete-merged: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95d9b8b..07b189e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,5 +2,48 @@ on: [push, pull_request, workflow_dispatch] jobs: build: - uses: ./.github/workflows/build-user-config.yml + runs-on: docker + container: + image: zmkfirmware/zmk-build-arm:stable + steps: + - name: Install Dependencies + run: | + apt-get update + apt-get install tree curl -y + - name: Install Node.JS Workarround, see https://github.com/nektos/act/issues/973 + run: | + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs + node --version + + - name: Git checkout + uses: actions/checkout@v4 + - name: Clone ZMK Repo + run: git clone -b feat/pointers-move-scroll https://github.com/petejohanson/zmk.git + + - name: Initialize ZMK + working-directory: ./zmk + run: | + west init -l app/ + west update + - name: Build Left Shield + working-directory: ./zmk/app + run: west build -d build/left -b nice_nano_v2 -- -DSHIELD=kyria_rev3_left -DZMK_CONFIG="../../config" + - name: Build Right Shield + working-directory: ./zmk/app + run: west build -d build/right -b nice_nano_v2 -- -DSHIELD=kyria_rev3_right -DZMK_CONFIG="../../config" + + - name: Rename artifacts + working-directory: . + run: | + mkdir "./artifacts" + cp ./zmk/app/build/left/zephyr/zmk.uf2 ./artifacts/kyria_rev3_left-nice_nano_v2-zmk.uf2 + cp ./zmk/app/build/right/zephyr/zmk.uf2 ./artifacts/kyria_rev3_right-nice_nano_v2-zmk.uf2 + + - name: Upload Artifacts + if: ${{ true }} + uses: actions/upload-artifact@v3 + with: + name: firmware + path: ./artifacts