name: Build QMK firmware on: pull_request: push: branches: - main - master - 'develop**' - github-actions-build workflow_dispatch: jobs: gather-keyboards: runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v4 with: repository: ${{ github.repository}} ref: ${{ github.ref }} - id: set-matrix run: | content=$(bash bin/fp_build.sh -l | sed s~keyboards/fingerpunch/~~| jq -Rsc '. / "\n" - [""]') content="{\"keyboard\":$content}" echo "matrix=$content" >> $GITHUB_OUTPUT Build: needs: gather-keyboards runs-on: ubuntu-latest container: ghcr.io/qmk/qmk_cli@sha256:16c4916e95b99bf88d27b15aec8db409ee17265d1710287fde248c6666508966 strategy: fail-fast: false matrix: ${{fromJson(needs.gather-keyboards.outputs.matrix)}} steps: - name: Checkout QMK uses: actions/checkout@v4 with: repository: ${{ github.repository}} ref: ${{ github.ref }} submodules: recursive - name: Build firmware shell: bash run: | wget -q https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -O jq chmod +x jq mv jq /usr/local/sbin/ keyboards=$(bash bin/fp_build.sh -l| sed s~keyboards/fingerpunch/~~) echo "${keyboards}" | while IFS= read -r line ; do case "$line" in *${{ matrix.keyboard }}*) echo "Building for ${line}" make_command="bin/fp_build.sh -k ${line} -r" echo "${make_command}" $make_command ;; esac done - name: Prepare keyboard name for Artifacts id: prep_artifact_name run: | # Calculate a unique string which applies to the matrix entry # that we can use to construct unique and valid artifact names. # We achieve that by squashing runs of characters are invalid # in artifact names, and also whitespace and dashes, into a # single dash character. The unique string will appear as # the environment variable ARTIFACT_NAME in subsequent actions. name="${{ matrix.keyboard }}" # The option to enable + in sed regexps differs by OS so we avoid it name=$(echo -n "$name" | sed -e 's/[ \t:\/\\"<>|*?]/_/g' -e 's/__*/_/g') echo "KB_CLEAN_ARTIFACT_NAME=$name" >> $GITHUB_ENV - name: Archive firmware uses: actions/upload-artifact@v4 continue-on-error: true with: name: qmk_fingerpunch_${{ env.KB_CLEAN_ARTIFACT_NAME }} path: | *.hex *.bin *.uf2