Skip to content

Commit

Permalink
Stub workflow to regen keycode files
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr committed Dec 22, 2022
1 parent e5721bb commit bf3208a
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 73 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/regen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR Regenerate Files

permissions:
contents: read

on:
pull_request:
paths:
- 'data/constants/**'
- 'lib/python/**'

jobs:
regen:
runs-on: ubuntu-latest

container: qmkfm/qmk_cli

steps:
- uses: actions/checkout@v3

- name: Run qmk generators
run: |
util/regen.sh
git diff
- name: Fail when regeneration required
run: |
git diff
for file in $(git diff --name-only); do
echo "File '${file}' Requires Regeneration"
echo "::error file=${file}::Requires Regeneration"
done
test -z "$(git diff --name-only)"
43 changes: 43 additions & 0 deletions .github/workflows/regen_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Regenerate Files

permissions:
contents: write

on:
push:
branches:
- master
- develop

jobs:
regen:
runs-on: ubuntu-latest

container: qmkfm/qmk_cli

steps:
- uses: actions/checkout@v3

- name: Run qmk generators
run: |
util/regen.sh
git diff
- uses: rlespinasse/[email protected]

- name: Become QMK Bot
run: |
git config user.name 'QMK Bot'
git config user.email '[email protected]'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
if: ${{ github.repository == 'qmk/qmk_firmware'}}
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
delete-branch: true
branch: bugfix/format_${{ env.GITHUB_REF_SLUG }}
author: QMK Bot <[email protected]>
committer: QMK Bot <[email protected]>
commit-message: Regenerate Files
title: '[CI] Regenerate Files'
65 changes: 0 additions & 65 deletions util/lang_conv.py

This file was deleted.

8 changes: 0 additions & 8 deletions util/lang_gen.sh

This file was deleted.

9 changes: 9 additions & 0 deletions util/regen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

qmk generate-rgb-breathe-table -o quantum/rgblight/rgblight_breathe_table.h
qmk generate-keycodes --version latest -o quantum/keycodes.h

for lang in $(find data/constants/keycodes/extras/ -type f -printf "%f\n" | sed "s/keycodes_\(.*\)_[0-9].*/\1/"); do
qmk generate-keycode-extras --version latest --lang $lang -o quantum/keymap_extras/keymap_$lang.h
done

0 comments on commit bf3208a

Please sign in to comment.