Skip to content

Commit 7484fa4

Browse files
committed
feat: Add gha to generate case
1 parent c864de0 commit 7484fa4

1 file changed

Lines changed: 119 additions & 0 deletions

File tree

.github/workflows/make_case.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Make Case
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
low-case:
6+
description: 'If enabled, this will lower the height of the tray and frame such that they stop at the switch snap-on point.'
7+
type: boolean
8+
default: false
9+
switch-type:
10+
description: 'MX or Choc (V1 or V2). Allowed values: "mx", "choc".'
11+
required: true
12+
type: string
13+
mcu:
14+
description: 'MCU used. Allowed values: "xiao", "rp2040-zero", "either".'
15+
required: true
16+
type: string
17+
smd-mcu:
18+
description: 'MCU is mounted SMD'
19+
type: boolean
20+
default: false
21+
mcu-socket-height:
22+
description: 'The height of the sockets in millimeters above the PCB. Default 4.7mm (round pin sockets)'
23+
required: true
24+
default: "4.7"
25+
battery:
26+
description: 'Battery type used. Allowed values: "none", "coin", "lipo".'
27+
required: true
28+
type: string
29+
no-usb-a:
30+
description: "Xiao MCU used without a usb-A 3.0 port."
31+
type: boolean
32+
default: false
33+
block-usb:
34+
description: "Xiao MCU used with a usb-A 3.0 port, but the port is blocked by the case."
35+
type: boolean
36+
default: false
37+
tenting:
38+
description: 'Integrated tenting options. Allowed values: "none", "magsafe", "puck". A magsafe sticker (inner diameter 46mm, outer diameter 56mm, thickness 0.7mm or less) or the SplitKB tenting puck.'
39+
default: none
40+
type: string
41+
smd-diodes:
42+
description: 'Set this flag if you are using SMD diodes. Will slightly reduce the height of the case.'
43+
type: boolean
44+
default: false
45+
expose:
46+
description: "Select components which shouldn't be covered up by the tray. Allowed values: comma-separated list of 'mcu', 'battery', 'usb'. Note that 'battery' only has an effect if 'coin' is selected."
47+
required: true
48+
type: string
49+
outer-keys:
50+
description: 'Which outer pinky keys should be enabled. Allowed values: "all", "upper-1.5u", "upper-1u", "lower", "none". All sets the upper key to 1.5u.'
51+
required: true
52+
type: string
53+
inner-index:
54+
description: 'Adjust the number and position of the inner index keys for better comfort. Allowed values: "all", "reduced", "flex". Flex allows either configuration to be used.'
55+
required: true
56+
type: string
57+
remove-num-row:
58+
description: 'Removes the num row keys by covering them up with the tray.'
59+
type: boolean
60+
default: false
61+
thumb-type:
62+
description: 'Select what thumb cluster type should be used. Allowed values: "ripple", "all-1u", "classic", "flex". Classic is 1u-1u-1.5u. Flex allows for any of the three options, but may be less stable.'
63+
required: true
64+
type: string
65+
thumbs:
66+
description: 'Select which thumbs to use. Allowed values: comma-separated list of "reachy", "tucky", "middle".'
67+
required: true
68+
type: string
69+
thumb-adjustment:
70+
description: 'Move the thumb cluster. Format: "x,y,r" where x is the number of mm that the cluster should be moved inwards, y is the number of mm that the cluster should be moved downwards, and r is the clockwise rotation in degrees around the outermost down-most corner of the cluster.'
71+
required: true
72+
default: "0,0,0"
73+
pinkies:
74+
description: 'Select which pinky keys to use. Allowed values: comma-separated list of "upper", "home", "lower".'
75+
required: true
76+
type: string
77+
jobs:
78+
Explore-GitHub-Actions:
79+
runs-on: ubuntu-24.04
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Set up Python
83+
uses: actions/setup-python@v2
84+
with:
85+
python-version: '3.12'
86+
87+
- name: Install dependencies
88+
run: |
89+
python -m pip install --upgrade pip
90+
pip install build123d=0.9.1
91+
92+
- name: Run Python command
93+
run: |
94+
python case/make_case.py \
95+
${{ github.event.inputs['low-case'] && '--low-case' || '' }} \
96+
${{ github.event.inputs['smd-mcu'] && '--smd-mcu' || '' }} \
97+
${{ github.event.inputs['no-usb-a'] && '--no-usb-a' || '' }} \
98+
${{ github.event.inputs['block-usb'] && '--block-usb' || '' }} \
99+
${{ github.event.inputs['smd-diodes'] && '--smd-diodes' || '' }} \
100+
${{ github.event.inputs['remove-num-row'] && '--remove-num-row' || '' }} \
101+
--switch-type ${{ github.event.inputs['switch-type'] }} \
102+
--mcu ${{ github.event.inputs['mcu'] }} \
103+
--mcu-socket-height ${{ github.event.inputs['mcu-socket-height'] }} \
104+
--battery ${{ github.event.inputs['battery'] }} \
105+
--tenting ${{ github.event.inputs['tenting'] }} \
106+
--expose ${{ github.event.inputs['expose'] }} \
107+
--outer-keys ${{ github.event.inputs['outer-keys'] }} \
108+
--inner-index ${{ github.event.inputs['inner-index'] }} \
109+
--thumb-type ${{ github.event.inputs['thumb-type'] }} \
110+
--thumbs ${{ github.event.inputs['thumbs'] }} \
111+
--thumb-adjustment "${{ github.event.inputs['thumb-adjustment'] }}" \
112+
--pinkies "${{ github.event.inputs['pinkies'] }}" \
113+
--export-stl
114+
115+
- name: Archive (${{ env.display_name }})
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: apiaster-case-stl
119+
path: case/stl/

0 commit comments

Comments
 (0)