Skip to content

Commit

Permalink
Merge pull request #547 from koron/flexible-gha-build
Browse files Browse the repository at this point in the history
Flexible GHA build
  • Loading branch information
koron authored Apr 9, 2024
2 parents 778e565 + 5bb94e9 commit f566517
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 78 deletions.
48 changes: 0 additions & 48 deletions .github/actions/setup-qmk/action.yml

This file was deleted.

37 changes: 9 additions & 28 deletions .github/workflows/build.yml → .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ name: Build all firmwares
on:
push:
paths:
- 'qmk_firmware/keyboards/keyball/**.mk'
- 'qmk_firmware/keyboards/keyball/**.c'
- 'qmk_firmware/keyboards/keyball/**.h'
- 'qmk_firmware/keyboards/keyball/**.json'
- '.github/actions/setup-qmk/**.yml'
- '.github/workflows/build*.yml'
- '.github/**.yml'
tags-ignore:
- '*'
branches:
- '*'

pull_request:
paths:
- 'qmk_firmware/keyboards/keyball/**.mk'
- 'qmk_firmware/keyboards/keyball/**.c'
- 'qmk_firmware/keyboards/keyball/**.h'
- 'qmk_firmware/keyboards/keyball/**.json'
- '.github/actions/setup-qmk/**.yml'
- '.github/workflows/build*.yml'
- '.github/**.yml'

workflow_call: {}

Expand All @@ -41,30 +41,11 @@ jobs:
- keyboard: keyball46
keymap: via_Both

name: Build ${{ matrix.keyboard }} w/ ${{ matrix.keymap }}

runs-on: ubuntu-latest
container:
image: ghcr.io/qmk/qmk_cli:latest

steps:

- name: Checkout source
uses: actions/checkout@v4

- name: Checkout qmk_firmware
uses: ./.github/actions/checkout-qmk_firmware

- name: Install a link to own source
run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- run: qmk compile -j 4 -kb keyball/${{ matrix.keyboard }} -km ${{ matrix.keymap }}

- name: Archive built firmware
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.keyboard }}-${{ matrix.keymap }}-firmware
path: __qmk__/*.hex
uses: ./.github/workflows/build-firmware.yml
with:
qmk_version: '0.22.14'
keyboard: ${{ matrix.keyboard }}
keymap: ${{ matrix.keymap }}

check-size:
name: Check size
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/build-firmware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build a firmware

on:

workflow_call:
inputs:
qmk_version:
default: '0.22.14'
type: string
required: false
keyboard:
type: string
required: true
keymap:
type: string
required: true

jobs:

build:

name: Build a firmware ${{ inputs.keyboard }}:${{ inputs.keymap }}

runs-on: ubuntu-latest
container:
image: ghcr.io/qmk/qmk_cli:latest

steps:

- name: Checkout source
uses: actions/checkout@v4

- name: Checkout qmk_firmware
uses: ./.github/actions/checkout-qmk_firmware

- name: Install a link to own source
run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- name: Compile and link
run: qmk compile -j 4 -kb keyball/${{ inputs.keyboard }} -km ${{ inputs.keymap }}

- name: Archive built firmware
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.keyboard }}-${{ inputs.keymap }}-firmware
path: __qmk__/*.hex
30 changes: 30 additions & 0 deletions .github/workflows/build-user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build a firmware on demand

on:
workflow_dispatch:
inputs:
keyboard:
description: 'Keyboard'
required: true
type: choice
options:
- keyball39
- keyball44
- keyball61
- keyball46
- one47
keymap:
description: 'Keymap'
required: true
type: string
default: 'default'

jobs:

build:

uses: ./.github/workflows/build-firmware.yml
with:
qmk_version: '0.22.14'
keyboard: ${{ inputs.keyboard }}
keymap: ${{ inputs.keymap }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

build:
name: Build firmwares
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/build-all.yml

deploy:
name: Deploy firmwares
Expand Down
17 changes: 16 additions & 1 deletion qmk_firmware/keyboards/keyball/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,19 @@ There are three keymaps provided at least:

## How to create your keymap

(TO BE DOCUMENTED)
1. Fork this Yowkees/keyball repository
2. Checkout forked repository
3. (OPTIONAL) Create a new branch
4. Add a your keymap, or make some changes
5. Commit changes and push it to your forked repository
6. Open your forked repository with web browser
7. Click and open "Actions" tab
8. Click "Build a firmware on demand" in Workflows on left panel
9. Press "Run workflow" button on right side, then you will see forms
10. (OPTIONAL) Select a your working branch
11. Select a "Keyboard" from drop-down list
12. Enter the "keymap" you want to build
13. Click "Run workflow"
14. Wait a minute until the firmware build is finished
15. Click a latest workflow run and open details
16. Download built firmware in "Artifacts" section

0 comments on commit f566517

Please sign in to comment.