-
Notifications
You must be signed in to change notification settings - Fork 1
175 lines (148 loc) · 6.72 KB
/
Copy pathrelease.yml
File metadata and controls
175 lines (148 loc) · 6.72 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
166
167
168
169
170
171
172
173
174
175
name: Build and Release Firmware
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version_tag:
description: "Version Tag for Manual Release (e.g., v1.0.0-beta)"
required: true
default: "v-manual"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout vtOS repository
uses: actions/checkout@v4
with:
path: vtOS
- name: Cache MicroPython Repository and Submodules
id: cache-micropython
uses: actions/cache@v4
with:
path: micropython
key: micropython-v1.28.0-rec-v1
- name: Checkout MicroPython repository (On Cache Miss)
if: steps.cache-micropython.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: micropython/micropython
ref: v1.28.0
submodules: "recursive"
path: micropython
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libffi-dev git pkg-config python3 python3-pip python3-virtualenv ccache
# --- ESP-IDF and Toolchain Cache ---
- name: Cache ESP-IDF and Toolchains
id: cache-esp-idf
uses: actions/cache@v4
with:
path: |
~/esp/esp-idf
~/.espressif
key: esp-idf-v5.5.1-v1
- name: Setup ESP-IDF (On Cache Miss)
if: steps.cache-esp-idf.outputs.cache-hit != 'true'
run: |
mkdir -p $HOME/esp
cd $HOME/esp
git clone --recursive -b v5.5.1 https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh esp32s3
# --- Compiler ccache ---
- name: Setup Compiler Cache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-esp-idf-${{ github.sha }}
restore-keys: |
ccache-esp-idf-
- name: Prepare Board Definitions and Submodules
run: |
# Freshly copy your local board configurations over to the ported structure
rm -rf micropython/ports/esp32/boards/LILYGO_T_DECK
cp -r vtOS/boards/LILYGO_T_DECK micropython/ports/esp32/boards/
# Commit the copied board files into the micropython checkout so
# `git describe --dirty` (used for the version banner) doesn't
# flag the build as dirty just because of this copy -- same fix
# as the Makefile's build target. Then move the local v1.28.0
# tag onto HEAD unconditionally (not just on a fresh commit --
# a cache hit may already be sitting 1+ commits past the tag
# from a prior run, and that needs re-tagging too, or describe
# keeps reporting "v1.28.0-N-g<hash>" forever) so describe
# reports a clean "v1.28.0".
git -C micropython add -A
git -C micropython -c user.email="build@vtos.local" -c user.name="vtOS Build" commit -q -m "vtOS board files" || true
git -C micropython tag -f v1.28.0 || true
. $HOME/esp/esp-idf/export.sh
cd micropython
# This step catches any architecture-specific submodules if required
make -C ports/esp32 submodules
- name: Build mpy-cross (MicroPython Cross-Compiler)
run: |
cd micropython/mpy-cross
make clean || true # Clean build artifacts if pulled from cache
make
- name: Compile T-Deck Firmware Binary
run: |
export MPY_USER_DIR=$(pwd)/micropython
cp $GITHUB_WORKSPACE/vtOS/modules/idf_component.yml micropython/ports/esp32/main/idf_component.yml
# Same reasoning as the board-files commit above -- keep the
# checkout non-dirty, and always re-tag HEAD (not just on a
# fresh commit) so describe reports a clean "v1.28.0" rather
# than "v1.28.0-N-g<hash>".
git -C micropython add -A
git -C micropython -c user.email="build@vtos.local" -c user.name="vtOS Build" commit -q -m "vtOS idf_component.yml" || true
git -C micropython tag -f v1.28.0 || true
cd micropython/ports/esp32
# Works around an ESP-IDF v5.5.1 packaging bug: this target's
# esp_hw_support/mspi_timing_tuning build unconditionally
# references an esp32s3 include/ dir this IDF version doesn't
# actually ship, which fails the build without this. See the
# Makefile's build target for the same workaround (confirmed
# still required even on a full clean rebuild) -- this step
# has no local Docker equivalent, so needs it explicitly here.
mkdir -p $HOME/esp/esp-idf/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/include
. $HOME/esp/esp-idf/export.sh
export MPY_USER_MODULES_DIR="$GITHUB_WORKSPACE/vtOS/modules"
# Wipe previous hardware builds if compiling on a workspace cache hit
make BOARD=LILYGO_T_DECK clean || true
if ! make BOARD=LILYGO_T_DECK CCACHE_ENABLE=1 \
USER_C_MODULES=$GITHUB_WORKSPACE/vtOS/modules \
FROZEN_MANIFEST=$GITHUB_WORKSPACE/vtOS/modules/manifest.py; then
echo "===================================================="
echo " COMPILATION FAILED: DUMPING LOG DIRECTORY "
echo "===================================================="
cat build-LILYGO_T_DECK/log/* || true
exit 1
fi
- name: Prepare Release Artifacts
run: |
mkdir -p release_assets
BUILD_DIR=micropython/ports/esp32/build-LILYGO_T_DECK
# Use fallback naming if running manually without a git release tag reference context
REF_NAME="${{ github.ref_name }}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
REF_NAME="${{ github.event.inputs.version_tag }}"
fi
cp $BUILD_DIR/firmware.bin release_assets/vtOS-$REF_NAME.bin
cp $BUILD_DIR/bootloader/bootloader.bin release_assets/bootloader.bin
cp $BUILD_DIR/partition_table/partition-table.bin release_assets/partition-table.bin
cd release_assets
zip -r ../vtOS-$REF_NAME.zip ./*
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version_tag || github.ref_name }}
name: Release ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version_tag || github.ref_name }}
target_commitish: ${{ github.sha }}
files: |
vtOS-*.zip
release_assets/vtOS-*.bin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}