diff --git a/.github/workflows/build-inputs.yml b/.github/workflows/build-inputs.yml index bb34abb..0f0c01e 100644 --- a/.github/workflows/build-inputs.yml +++ b/.github/workflows/build-inputs.yml @@ -40,12 +40,8 @@ on: description: 'Kconfig' required: false default: 'default' - zmk: - description: 'ZMK' - required: false - default: 'default' merge: - description: 'Merge' + description: 'ZMK Branches' required: false default: 'default' jobs: @@ -61,7 +57,6 @@ jobs: mapping: ${{ steps.process-inputs.outputs.mapping }} config: ${{ steps.process-inputs.outputs.config }} kconfig: ${{ steps.process-inputs.outputs.kconfig }} - zmk: ${{ steps.process-inputs.outputs.zmk }} merge: ${{ steps.process-inputs.outputs.merge }} steps: - name: Process inputs @@ -81,7 +76,6 @@ jobs: set-output "mapping" "${{ github.event.inputs.mapping }}" set-output "config" "${{ github.event.inputs.config }}" set-output "kconfig" "${{ github.event.inputs.kconfig }}" - set-output "zmk" "${{ github.event.inputs.zmk }}" set-output "merge" "${{ github.event.inputs.merge }}" build: uses: manna-harbour/zmk-config/.github/workflows/main.yml@31a649e5571b4572d7010561dd3f191922cd9410 @@ -96,5 +90,4 @@ jobs: mapping: ${{ needs.process-inputs.outputs.mapping }} config: ${{ needs.process-inputs.outputs.config }} kconfig: ${{ needs.process-inputs.outputs.kconfig }} - zmk: ${{ needs.process-inputs.outputs.zmk }} merge: ${{ needs.process-inputs.outputs.merge }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba3383e..fbadaf3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,9 +32,6 @@ on: kconfig: type: string default: '["default"]' - zmk: - type: string - default: '["default"]' merge: type: string default: '["default"]' @@ -56,7 +53,6 @@ jobs: mapping: ${{ fromJSON(inputs.mapping) }} config: ${{ fromJSON(inputs.config) }} kconfig: ${{ fromJSON(inputs.kconfig) }} - zmk: ${{ fromJSON(inputs.zmk) }} merge: ${{ fromJSON(inputs.merge) }} steps: - name: Checkout @@ -119,7 +115,18 @@ jobs: if [ -n "${{ matrix.merge }}" -a "${{ matrix.merge }}" != 'default' ] then artifact_build_name="$artifact_build_name merge_"`echo "${{ matrix.merge }}" | md5sum | cut -d ' ' -f 1` + for branch in ${{ matrix.merge }} + do + if [ `echo "$branch" | cut -c1` = '=' ] + then + zmk=`echo "$branch" | cut -c2-` + else + merge="$merge $branch" + fi + done fi + echo "::set-output name=merge::$merge" + echo "::set-output name=zmk::$zmk" outboard_dir=".github/workflows/outboards" if [ -n "$shield" ] @@ -166,12 +173,12 @@ jobs: run: | cp ${{ steps.variables.outputs.outboard_chekout_dir }}/${{ env.outboard_manifest }} config/west.yml cat config/west.yml - - name: Generate manifest from zmk field - if: ${{ matrix.zmk != '' && matrix.zmk != 'default' }} + - name: Generate manifest from merge field + if: ${{ steps.variables.outputs.zmk != '' }} run: | - user=`echo ${{ matrix.zmk }} | cut -f 1 -d '/'` - repo=`echo ${{ matrix.zmk }} | cut -f 2 -d '/'` - branch=`echo ${{ matrix.zmk }} | cut -f 3- -d '/'` + user=`echo ${{ steps.variables.outputs.zmk }} | cut -f 1 -d '/'` + repo=`echo ${{ steps.variables.outputs.zmk }} | cut -f 2 -d '/'` + branch=`echo ${{ steps.variables.outputs.zmk }} | cut -f 3- -d '/'` remote="$user-$repo" echo "manifest:\n remotes:\n - name: $remote\n url-base: https://github.com/$user\n projects:\n - name: zmk\n remote: $remote\n repo-path: $repo\n revision: $branch\n import: app/west.yml\n self:\n path: config" > config/west.yml cat config/west.yml @@ -193,12 +200,12 @@ jobs: - name: Update west projects run: west update - name: Merge branches and update - if: ${{ matrix.merge != '' && matrix.merge != 'default' }} + if: ${{ steps.variables.outputs.merge != '' }} run: | cd zmk git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - for merge in ${{ matrix.merge }} + for merge in ${{ steps.variables.outputs.merge }} do user=`echo "$merge" | cut -f 1 -d '/'` repo=`echo "$merge" | cut -f 2 -d '/'` diff --git a/readme.org b/readme.org index 78a97be..ef21359 100644 --- a/readme.org +++ b/readme.org @@ -139,14 +139,15 @@ Appends to the [[#config-file][config]] file. Join multiple lines with ~\n~. F Appends to [[#kconfig-configuration][Kconfig configuration]]. Join multiple lines with ~\n~. For no additonal config, leave as ~default~. -****** ZMK Fork / zmk +****** ZMK Branches / merge -Used to build from an alternative ZMK fork. The branch is specified as ~//~. For the default ZMK branch, leave as ~default~. +Used to select an alternative ZMK branch for building, and to merge branches into ZMK at build time. +An alternative ZMK branch for building is specified as ~=//~, i.e. with a leading ~=~. E.g. the default ZMK branch would be specified as ~=zmkfirmware/zmk/main~. -****** Merge ZMK Branches / merge +Branches for merging are specified as ~//~, i.e. with no leading ~=~. E.g. the default ZMK branch would be specified as ~zmkfirmware/zmk/main~. -Used to merge branches into ZMK at build time. Branches are specified as ~//~. To merge multiple branches, separate with space. For no merges, leave as ~default~. +To specify multiple branches, separate with space. For no changes, leave as ~default~. ** Supported Keyboards