forked from BruceDevices/firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 12
165 lines (150 loc) · 5.38 KB
/
manual_build_sel_env.yml
File metadata and controls
165 lines (150 loc) · 5.38 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Manual Build (Select Environment)
# All credits to Ninja-Jr @ninjajr
on:
workflow_dispatch:
inputs:
target_branch:
description: 'Branch to build from'
required: true
default: 'main'
type: string
environment:
description: 'Select environment to build'
required: true
default: 'lilygo-t-embed-cc1101'
type: choice
options:
- "m5stack-cardputer"
- "m5stack-cplus2"
- "m5stack-cplus1_1"
- "LAUNCHER_m5stack-cplus1_1"
- "m5stack-core2"
- "m5stack-core16mb"
- "m5stack-core4mb"
- "m5stack-cores3"
- "esp32-s3-devkitc-1"
- "esp32-c5"
- "esp32-c5-tft"
- "CYD-2432S028"
- "CYD-2USB"
- "CYD-2432W328C"
- "CYD-2432W328C_2"
- "CYD-2432W328R-or-S024R"
- "CYD-3248S035R"
- "CYD-3248S035C"
- "LAUNCHER_CYD-2432W328R-or-S024R"
- "LAUNCHER_CYD-2432S028"
- "LAUNCHER_CYD-2USB"
- "LAUNCHER_CYD-2432W328C"
- "LAUNCHER_CYD-3248S035R"
- "LAUNCHER_CYD-3248S035C"
- "lilygo-t-embed-cc1101"
- "lilygo-t-embed"
- "lilygo-t-deck"
- "lilygo-t-watch-s3"
- "lilygo-t-deck-pro"
- "lilygo-t-display-s3"
- "lilygo-t-display-s3-touch"
- "lilygo-t-display-s3-mmc"
- "lilygo-t-display-s3-touch-mmc"
- "lilygo-t-display-s3-pro"
- "lilygo-t-display-ttgo"
- "lilygo-t-hmi"
- "lilygo-t-lora-pager"
- "smoochiee-board"
- "Phantom_S024R"
- "LAUNCHER_Phantom_S024R"
- "Marauder-Mini"
- "LAUNCHER_Marauder-Mini"
- "Awok-Mini"
- "Marauder-v7"
- "LAUNCHER_Marauder-v7"
- "Marauder-V4-V6"
- "Marauder-v61"
- "LAUNCHER_Marauder-V4-V6"
- "LAUNCHER_Marauder-v61"
- "Awok-Touch"
- "WaveSentry-R1"
- "LAUNCHER_WaveSentry-R1"
jobs:
compile_selected:
name: Build ${{ github.event.inputs.environment }}
runs-on: ubuntu-latest
env:
SELECTED_ENV: ${{ github.event.inputs.environment }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.target_branch }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
${{ runner.os }}-pip-
- name: Cache PlatformIO Framework
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-platformio-${{ hashFiles('platformio.ini') }}
${{ runner.os }}-platformio-
- name: PIO libraries cache
uses: actions/cache@v4
with:
path: .pio/libdeps
key: ${{ runner.os }}-pio-${{ env.SELECTED_ENV }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ env.SELECTED_ENV }}-${{ hashFiles('platformio.ini') }}
${{ runner.os }}-pio-${{ env.SELECTED_ENV }}-
- name: Install dependencies
run: |
pip install requests esptool intelhex
pip install platformio
- name: Prepare PlatformIO file (Bruce version logic)
id: prepare_version
run: |
echo "Preparing PlatformIO configuration..."
# Manual builds always use commit SHA (simple and logical)
version="${GITHUB_SHA::7}"
echo "Using commit SHA: $version"
echo "VERSION=$version" >> $GITHUB_OUTPUT
# Apply version to platformio.ini (upstream method)
sed -i "s/-DBRUCE_VERSION=/-DBRUCE_VERSION='\"$version\"' ; /g" ./platformio.ini
sed -i "s/-DGIT_COMMIT_HASH='\"Homebrew\"'/!echo '-DGIT_COMMIT_HASH=\\\\\"'\$(git describe --always --dirty)'\\\\\"'/g" ./platformio.ini
- name: Run Compile
run: |
set -o pipefail
echo "Building environment: ${{ env.SELECTED_ENV }}"
platformio run -e "${{ env.SELECTED_ENV }}" | tee "build-${{ env.SELECTED_ENV }}.log"
- name: Build summary
run: |
if [[ -f "build-${{ env.SELECTED_ENV }}.log" ]]; then
echo "Last 75 lines of build-${{ env.SELECTED_ENV }}.log:"
tail -n 75 "build-${{ env.SELECTED_ENV }}.log"
else
echo "Build log not found; nothing to show."
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Bruce-${{ env.SELECTED_ENV }}
path: Bruce-*.*
retention-days: 1
if-no-files-found: error
- name: Display Build Info
run: |
echo "Build completed successfully!"
echo "Environment: ${{ env.SELECTED_ENV }}"
echo "Version: ${{ steps.prepare_version.outputs.VERSION }}"
echo "Git Hash: $(git describe --always --dirty)"
echo "Built files:"
ls -la Bruce-*.* 2>/dev/null || echo "No Bruce files found"