diff --git a/.github/workflows/draw-keymaps.yml b/.github/workflows/draw-keymaps.yml index 2bbfa5c..60523bc 100644 --- a/.github/workflows/draw-keymaps.yml +++ b/.github/workflows/draw-keymaps.yml @@ -5,6 +5,7 @@ on: paths: - "config/*.keymap" - "config/keymap_drawer.yaml" + - "config/info.json" env: km_dr_version: main km_dr_config: config/keymap_drawer.yaml @@ -36,19 +37,17 @@ jobs: - name: Parse run: | # TODO set generic vars in one place globally - KEYBOARD="${{ env.keyboard }}" - KEYMAP="config/${KEYBOARD}.keymap" + KEYMAP="config/${{ env.keyboard }}.keymap" CONFIG="${{ env.km_dr_config }}" - OUTPUT="${{ env.output_folder }}/${KEYBOARD}.yaml" + OUTPUT="${{ env.output_folder }}/${{ env.keyboard }}.yaml" keymap -c "$CONFIG" parse -z "$KEYMAP" > "$OUTPUT" - name: Draw keymap run: | - KEYBOARD="${{ env.keyboard }}" - KEYMAP="config/${KEYBOARD}.yaml" + KEYMAP="${{ env.output_folder }}/${{ env.keyboard }}.yaml" INFO="config/info.json" CONFIG="${{ env.km_dr_config }}" - OUTPUT="${{ env.output_folder }}/${KEYBOARD}.svg" + OUTPUT="${{ env.output_folder }}/${{ env.keyboard }}.svg" keymap -c "$CONFIG" draw "$KEYMAP" -j "$INFO" > "$OUTPUT" - name: Draw layer keymap @@ -56,15 +55,14 @@ jobs: # Ensure errors propagate when piping stdout set -o pipefail - KEYBOARD="${{ env.keyboard }}" - KEYMAP="config/${KEYBOARD}.yaml" + KEYMAP="${{ env.output_folder }}/${{ env.keyboard }}.yaml" INFO="config/info.json" CONFIG="${{ env.km_dr_config }}" # Function to draw the given layer's keymap draw() { LAYER="$1" - OUTPUT="${{ env.output_folder }}/${KEYBOARD}_${LAYER}.svg" + OUTPUT="${{ env.output_folder }}/${{ env.keyboard }}_${LAYER}.svg" keymap -c "$CONFIG" draw "$KEYMAP" -j "$INFO" -s "$LAYER" > "$OUTPUT" }