-
Notifications
You must be signed in to change notification settings - Fork 1
226 lines (183 loc) · 8.57 KB
/
dev-release.yml
File metadata and controls
226 lines (183 loc) · 8.57 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Dev Release - RPi ARMv7 Thunder
on:
push:
tags:
- 'dev-*'
env:
TZ: Etc/UTC
DEBIAN_FRONTEND: noninteractive
FORCE_UNSAFE_CONFIGURE: 1
CONFIG_NAME: raspberrypi_armv7_thunder
CCACHE_LIMIT: 3.5G
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository (without submodules)
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Set up SSH for private repos
run: |
mkdir -p ~/.ssh
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GHA_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
cat <<EOT >> ~/.ssh/config
Host github.com
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
EOT
echo "✅ SSH configured"
- name: Checkout submodules
run: |
echo "📦 Checking out submodules..."
git submodule sync --recursive
git submodule update --init --recursive
echo "✅ Submodules checked out"
- name: Cache downloads
uses: actions/cache@v4
with:
path: build/download
key: downloads-${{ hashFiles('.gitmodules') }}
restore-keys: |
downloads-
- name: Cache ccache (armv7)
uses: actions/cache@v4
with:
path: build/ccache
key: ccache-armv7-${{ hashFiles('.gitmodules') }}
restore-keys: |
ccache-armv7-
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get -qq --yes install apt-utils > /dev/null
sudo apt-get -qq --yes install \
subversion build-essential bison flex gettext libncurses5-dev texinfo \
autoconf automake libtool mercurial git-core gperf gawk expat curl cvs \
libexpat-dev bzr unzip bc python3-dev wget cpio rsync xxd libmpc-dev \
libgmp3-dev xz-utils file ccache > /dev/null
# Install multilib on x86_64
if [ "$(arch)" = "x86_64" ]; then
sudo apt-get -qq --yes install gcc-multilib g++-multilib > /dev/null
fi
echo "✅ Dependencies installed"
- name: Get git reference
id: ref
run: |
REF=$(git rev-parse --short HEAD)
echo "ref=$REF" >> $GITHUB_OUTPUT
echo "📌 Building reference: $REF"
echo "🏷️ Tag: ${{ github.ref_name }}"
- name: Download packages
run: |
export BR2_DL_DIR="${PWD}/build/download"
echo "📦 Downloading packages for $CONFIG_NAME..."
# Initialize config
make -C buildroot \
BR2_EXTERNAL="../buildroot-external-metrological-open-source" \
O=../build/$CONFIG_NAME \
${CONFIG_NAME}_defconfig
make -C build/$CONFIG_NAME syncconfig
# Download all sources
echo "⏬ Running 'make source'..."
time make -C build/$CONFIG_NAME source
echo "✅ Package download complete"
- name: Build ${{ env.CONFIG_NAME }}
run: |
export BR2_DL_DIR="${PWD}/build/download"
export BR2_CCACHE_DIR="${PWD}/build/ccache"
echo "🔨 Building $CONFIG_NAME..."
echo "⏰ Build started at $(date)"
# Add WPE WebKit parallel build optimization
echo 'BR2_PACKAGE_WPEWEBKIT_ML_PARALLEL_BUILD_JOBS="6"' >> ./build/$CONFIG_NAME/.config
# Compiler cache initial setup
echo 'BR2_CCACHE_INITIAL_SETUP="-M ${CCACHE_LIMIT} -z"' >> ./build/$CONFIG_NAME/.config
make -C build/$CONFIG_NAME syncconfig
# Build with timing
time make -C build/$CONFIG_NAME
echo "✅ Build completed at $(date)"
- name: Show build artifacts
run: |
echo "📁 Build artifacts:"
ls -lh ./build/$CONFIG_NAME/images/
- name: Show ccache statistics
run: |
echo "📊 ccache Statistics:"
./build/$CONFIG_NAME/host/usr/bin/ccache -s
- name: Compress image
run: |
echo "🗜️ Compressing image at $(date)..."
xz --verbose --keep --compress --stdout \
./build/$CONFIG_NAME/images/sdcard.img > \
./${CONFIG_NAME}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
# Show file size
echo ""
echo "📦 Compressed image:"
ls -lh ${CONFIG_NAME}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
# Calculate checksums
echo ""
echo "🔐 Checksums:"
sha256sum ${CONFIG_NAME}-${{ steps.ref.outputs.ref }}-sdcard.img.xz | tee ${CONFIG_NAME}-${{ steps.ref.outputs.ref }}-sdcard.img.xz.sha256
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
path: |
${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz.sha256
compression-level: 0 # Already compressed with xz
- name: Create pre-release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz.sha256
prerelease: true
generate_release_notes: true
body: |
## 🎉 Dev Build - ${{ env.CONFIG_NAME }}
**Configuration:** `${{ env.CONFIG_NAME }}_defconfig`
**Reference:** `${{ steps.ref.outputs.ref }}`
**Tag:** `${{ github.ref_name }}`
**Build Date:** ${{ github.event.head_commit.timestamp }}
**Triggered by:** @${{ github.actor }}
### 📦 Artifacts
- `${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz` - Compressed SD card image
- `${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz.sha256` - SHA256 checksum
### 🔧 Platform
- **Target:** Raspberry Pi (ARMv7 32-bit)
- **Variant:** Thunder
### ⚡ Usage
```bash
# Download and verify
wget https://github.com/WebPlatformForEmbedded/lithosphere/releases/download/${{ github.ref_name }}/${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
wget https://github.com/WebPlatformForEmbedded/lithosphere/releases/download/${{ github.ref_name }}/${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz.sha256
# Verify checksum
sha256sum -c ${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz.sha256
# Extract and flash
xz -d ${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img.xz
sudo dd if=${{ env.CONFIG_NAME }}-${{ steps.ref.outputs.ref }}-sdcard.img of=/dev/sdX bs=4M status=progress
sync
```
---
⚠️ **This is a development build for testing purposes.**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build summary
run: |
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ BUILD SUCCESSFUL"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📋 Configuration: $CONFIG_NAME"
echo "🏷️ Tag: ${{ github.ref_name }}"
echo "📌 Reference: ${{ steps.ref.outputs.ref }}"
echo "🎯 Platform: Raspberry Pi (ARMv7)"
echo ""
echo "📦 Artifact: ${CONFIG_NAME}-${{ steps.ref.outputs.ref }}-sdcard.img.xz"
echo "🔗 Release: https://github.com/WebPlatformForEmbedded/lithosphere/releases/tag/${{ github.ref_name }}"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"