Skip to content

Commit

Permalink
Merge pull request #83 from koron/improve-gha
Browse files Browse the repository at this point in the history
Imporeve GitHub Actions
  • Loading branch information
koron authored Jan 23, 2022
2 parents b733cf8 + 822dba5 commit 8719c10
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 38 deletions.
34 changes: 34 additions & 0 deletions .github/actions/setup-qmk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Setup QMK firmware'

inputs:
version:
default: '0.15.13'
type: string
required: false
path:
default: '__qmk__'
type: string
required: false

runs:
using: 'composite'
steps:
- name: Checkout qmk_firmware
uses: actions/checkout@v2
with:
path: ${{ inputs.path }}
repository: qmk/qmk_firmware
submodules: recursive
ref: ${{ inputs.version }}

- name: Install git and pip
shell: bash
run: sudo apt-get install -y git python3-pip

- name: Install QMK CLI
shell: bash
run: python3 -m pip install --user qmk

- name: Setup QMK
shell: bash
run: qmk setup --home ${{ inputs.path }} --yes
54 changes: 35 additions & 19 deletions .github/workflows/build-keyball46.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
name: Build Keyball46

on: push
on:
push:
branches:
- '*'
tags:
- 'keyball46/v[0-9]+.[0-9]+.[0-9]+*'
pull_request:

jobs:

build-keyball46-firmwares:
build:
name: Build Keyball46 firmwares
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Checkout qmk_firmware
uses: actions/checkout@v2
with:
path: __qmk__
repository: qmk/qmk_firmware
submodules: recursive
ref: '0.15.13'
- name: Setup QMK firmware
uses: ./.github/actions/setup-qmk

- name: Install a link to own source
run: ln -s /home/runner/work/keyball/keyball/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- name: Install git and pip
run: sudo apt-get install -y git python3-pip

- name: Install QMK CLI
run: python3 -m pip install --user qmk

- name: Setup QMK
run: qmk setup --home __qmk__ --yes
run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- run: qmk compile -j 4 -kb keyball/keyball46 -km default
continue-on-error: true
Expand All @@ -54,3 +46,27 @@ jobs:
with:
name: keyball46-firmwares
path: __qmk__/*.hex

release:
name: Release Keyball46 firmwares
runs-on: ubuntu-latest
needs: [ build ]
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'keyball46/v')

steps:
- name: Download built firmwares
uses: actions/download-artifact@v2
with:
name: keyball46-firmwares
- name: List assets
run: ls -l *.hex
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') }}
files: |
*.hex
fail_on_unmatched_files: true
generate_release_notes: true
append_body: true
54 changes: 35 additions & 19 deletions .github/workflows/build-keyball61.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
name: Build Keyball61

on: push
on:
push:
branches:
- '*'
tags:
- 'keyball61/v[0-9]+.[0-9]+.[0-9]+*'
pull_request:

jobs:

build-keyball61-firmwares:
build:
name: Build Keyball61 firmwares
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Checkout qmk_firmware
uses: actions/checkout@v2
with:
path: __qmk__
repository: qmk/qmk_firmware
submodules: recursive
ref: '0.15.13'
- name: Setup QMK firmware
uses: ./.github/actions/setup-qmk

- name: Install a link to own source
run: ln -s /home/runner/work/keyball/keyball/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- name: Install git and pip
run: sudo apt-get install -y git python3-pip

- name: Install QMK CLI
run: python3 -m pip install --user qmk

- name: Setup QMK
run: qmk setup --home __qmk__ --yes
run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball

- run: qmk compile -j 4 -kb keyball/keyball61 -km default
continue-on-error: true
Expand All @@ -46,3 +38,27 @@ jobs:
with:
name: keyball61-firmwares
path: __qmk__/*.hex

release:
name: Release Keyball61 firmwares
runs-on: ubuntu-latest
needs: [ build ]
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'keyball61/v')

steps:
- name: Download built firmwares
uses: actions/download-artifact@v2
with:
name: keyball61-firmwares
- name: List assets
run: ls -l *.hex
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') }}
files: |
*.hex
fail_on_unmatched_files: true
generate_release_notes: true
append_body: true

0 comments on commit 8719c10

Please sign in to comment.