Add workflow to build binary :)
Build firmware / build (push) Failing after 1m48s

This commit is contained in:
mindfulminun committed 2026-11-19 23:52:27 +00:00
1 parent c7c927fd11
commit bcdadb104d
1 file changed
+58
+58
View File
@@ -0,0 +1,58 @@
name: Build firmware
on:
push:
branches: [main]
workflow_dispatch:
env:
KEYBOARD: preonic/rev3
KEYMAP: mindfulminun
QMK_HOME: /root/qmk_firmware
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install toolchain and QMK CLI
run: |
apt-get update
apt-get install -y --no-install-recommends git make curl jq python3-pip pipx \
gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
pipx install qmk
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Clone QMK firmware
run: |
git clone --depth 1 --recurse-submodules --shallow-submodules -j8 \
https://github.com/qmk/qmk_firmware.git "$QMK_HOME"
- name: Compile
run: |
rm -f "$GITHUB_WORKSPACE"/*.bin
qmk config user.qmk_home="$QMK_HOME" user.overlay_dir="$GITHUB_WORKSPACE"
qmk compile -kb "$KEYBOARD" -km "$KEYMAP"
BIN=$(find "$QMK_HOME" "$GITHUB_WORKSPACE" -maxdepth 1 -name '*_mindfulminun.bin' | head -n1)
test -n "$BIN"
cp "$BIN" "$RUNNER_TEMP/firmware.bin"
echo "BIN_NAME=$(basename "$BIN")" >> "$GITHUB_ENV"
- name: Publish rolling "latest" release
run: |
set -euo pipefail
API="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}"
AUTH="Authorization: token ${{ gitea.token }}"
OLD=$(curl -sS -H "$AUTH" "$API/releases/tags/latest" | jq -r '.id // empty')
if [ -n "$OLD" ]; then curl -sS -X DELETE -H "$AUTH" "$API/releases/$OLD"; fi
curl -sS -X DELETE -H "$AUTH" "$API/tags/latest" || true
ID=$(curl -sSf -X POST -H "$AUTH" -H "Content-Type: application/json" "$API/releases" \
-d "$(jq -n --arg sha "${{ gitea.sha }}" \
'{tag_name:"latest", target_commitish:$sha, name:"Latest firmware", body:("Built from " + $sha)}')" \
| jq -r .id)
curl -sSf -H "$AUTH" -F "attachment=@$RUNNER_TEMP/firmware.bin" \
"$API/releases/$ID/assets?name=$BIN_NAME"