-
Notifications
You must be signed in to change notification settings - Fork 14
144 lines (122 loc) · 4.09 KB
/
Copy pathfirmware-build.yml
File metadata and controls
144 lines (122 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Firmware CI
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
pull_request:
branches:
- main
paths:
- "firmware/**"
- "config/**"
- "tools/studio/**"
- "tools/scripts/**"
- ".github/workflows/firmware-build.yml"
- ".github/workflows/release.yml"
- ".github/release.yml"
concurrency:
group: firmware-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-ch592f:
name: Build CH592F (${{ matrix.keyboard }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
keyboard:
- 5KEY
- KNOB
container:
image: ghcr.io/meowkj/binarykeyboard-builder:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Install Python
run: |
apt-get update -q
apt-get install -y --no-install-recommends python3
- name: Fix git ownership
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Build (JumpIAP + app + IAP)
run: python3 tools/scripts/ch592f.py build-full --keyboard ${{ matrix.keyboard }} --profile release
- name: Resolve artifacts
id: artifacts
run: |
echo "bin=$(python3 tools/scripts/ch592f.py artifact --keyboard ${{ matrix.keyboard }} --profile release --type bin)" >> "$GITHUB_OUTPUT"
echo "full_hex=$(python3 tools/scripts/ch592f.py artifact --keyboard ${{ matrix.keyboard }} --profile release --type full_hex)" >> "$GITHUB_OUTPUT"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: firmware-ch592f-${{ matrix.keyboard }}-${{ github.sha }}
path: |
${{ steps.artifacts.outputs.bin }}
${{ steps.artifacts.outputs.full_hex }}
retention-days: 7
build-ch552g:
name: Build CH552G (${{ matrix.keyboard }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
keyboard:
- BASIC
- KNOB
- 5KEY
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Install SDCC 4.6.0
run: |
SDCC_VER="4.6.0"
wget -q "https://sourceforge.net/projects/sdcc/files/sdcc-linux-amd64/${SDCC_VER}/sdcc-${SDCC_VER}-amd64-unknown-linux2.5.tar.bz2/download" -O sdcc.tar.bz2
tar xjf sdcc.tar.bz2
echo "${PWD}/sdcc-${SDCC_VER}/bin" >> "$GITHUB_PATH"
sudo apt-get update -q
sudo apt-get install -y ninja-build
- name: Build
run: python3 tools/scripts/ch552g.py build --keyboard ${{ matrix.keyboard }}
- name: Resolve artifacts
id: artifacts
run: |
echo "bin=$(python3 tools/scripts/ch552g.py artifact --keyboard ${{ matrix.keyboard }} --type bin)" >> "$GITHUB_OUTPUT"
echo "hex=$(python3 tools/scripts/ch552g.py artifact --keyboard ${{ matrix.keyboard }} --type hex)" >> "$GITHUB_OUTPUT"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: firmware-ch552g-${{ matrix.keyboard }}-${{ github.sha }}
path: |
${{ steps.artifacts.outputs.bin }}
${{ steps.artifacts.outputs.hex }}
retention-days: 7
build-studio:
name: Build Studio
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11.9.0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
cache-dependency-path: tools/studio/pnpm-lock.yaml
- name: Install dependencies
working-directory: tools/studio
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm --dir tools/studio run build