Repository navigation
295 lines (287 loc) · 13.7 KB
/
Copy pathrelease.yml
File metadata and controls
295 lines (287 loc) · 13.7 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Build and publish OpenWrt
run-name: OpenWrt ${{ inputs.openwrt_version || '25.12.5' }} · ${{ github.ref_name }}
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
openwrt_version:
description: OpenWrt release
default: '25.12.5'
required: true
kernel_ref:
description: linux-lts-e5 branch, tag or commit
default: e5-6.18
required: true
infoscreen_ref:
description: infoscreen branch, tag or commit
default: main
required: true
plugins_ref:
description: infoscreen-plugins branch, tag or commit
default: main
required: true
publish:
description: Publish a GitHub Release after validation
type: boolean
default: true
prerelease:
description: Mark the release as a prerelease
type: boolean
default: false
permissions:
contents: read
concurrency:
group: flash-release-${{ github.ref }}
cancel-in-progress: false
env:
TZ: CST-8
E5_WRT_VER: ${{ inputs.openwrt_version || '25.12.5' }}
jobs:
gui:
uses: ./.github/workflows/gui.yml
gui_macos:
uses: ./.github/workflows/gui-macos.yml
build:
needs: [gui, gui_macos]
runs-on: ubuntu-24.04-arm
timeout-minutes: 360
outputs:
tag: ${{ steps.start.outputs.release_tag }}
title: ${{ steps.verify.outputs.release_title }}
source: ${{ steps.source.outputs.commit }}
steps:
# Pipeline errors must survive tee, otherwise validation reports a later
# missing archive instead of the original build failure.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
submodules: recursive
fetch-depth: 0
persist-credentials: false
- name: Check bootstrap configuration
env:
INPUTS_URL: ${{ vars.E5_CI_INPUTS_URL }}
INPUTS_SHA256: ${{ vars.E5_CI_INPUTS_SHA256 }}
run: |
[[ "$INPUTS_URL" == https://* ]] || { echo '::error::Set E5_CI_INPUTS_URL to the HTTPS bootstrap archive URL (docs/RELEASE.md).'; exit 1; }
[[ "$INPUTS_SHA256" =~ ^[a-fA-F0-9]{64}$ ]] || { echo '::error::Set E5_CI_INPUTS_SHA256 to its SHA-256 (docs/RELEASE.md).'; exit 1; }
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
submodules: recursive
repository: Enceka/linux-lts-e5
ref: ${{ inputs.kernel_ref || vars.E5_KERNEL_REF || 'e5-6.18' }}
path: linux-lts-e5
fetch-depth: 128
persist-credentials: false
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
submodules: recursive
repository: Enceka/infoscreen
ref: ${{ inputs.infoscreen_ref || vars.E5_INFOSCREEN_REF || 'main' }}
path: ci/infoscreen
persist-credentials: false
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
submodules: recursive
repository: Enceka/infoscreen-plugins
ref: ${{ inputs.plugins_ref || vars.E5_PLUGINS_REF || 'main' }}
path: ci/infoscreen-plugins
persist-credentials: false
- name: Record sources and UTC+8 compile start
id: start
env:
E5_CI_INPUTS_SHA256: ${{ vars.E5_CI_INPUTS_SHA256 }}
E5_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: python3 tools/ci-release.py prepare
- name: Record e5-linux commit
id: source
run: echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Install host tools
run: |
sudo apt-get update
sudo apt-get install -y lz4 e2fsprogs binutils python3 qemu-user-static binfmt-support gcc pkg-config libglib2.0-dev libjson-c5 python3-gi dbus-daemon
# The checksum-pinned OpenWrt SDK is x86_64; the runner is ARM64.
sudo update-binfmts --enable qemu-x86_64
- name: Restore and verify bootstrap inputs
env:
INPUTS_URL: ${{ vars.E5_CI_INPUTS_URL }}
INPUTS_SHA256: ${{ vars.E5_CI_INPUTS_SHA256 }}
run: |
curl --fail --location --retry 5 --proto '=https' --proto-redir '=https' \
--output "$RUNNER_TEMP/ci-inputs.tar.gz" "$INPUTS_URL"
python3 tools/ci-inputs.py restore "$RUNNER_TEMP/ci-inputs.tar.gz" --sha256 "$INPUTS_SHA256"
- name: Check installer and audio logic
env:
OPENWRT_GUI_OPTIONAL: '1'
run: |
python3 devices/test_emmc_dma.py linux-lts-e5
bash -n openwrt/make-flash-bundle.sh openwrt/build-rootfs.sh upstream/build.sh
# The GPT and bounded-write tests need a disposable OpenWrt userspace.
mkdir -p work/openwrt
base="https://downloads.openwrt.org/releases/$E5_WRT_VER/targets/armsr/armv8"
file="openwrt-$E5_WRT_VER-armsr-armv8-rootfs.tar.gz"
curl -fsSL --retry 5 "$base/$file" -o "work/openwrt/$file"
curl -fsSL --retry 5 "$base/sha256sums" -o work/openwrt/sha256sums
checksum=$(awk -v file="$file" '$2 == "*" file || $2 == file { print $1 }' work/openwrt/sha256sums)
[ -n "$checksum" ] || { echo '::error::No checksum for OpenWrt rootfs'; exit 1; }
printf '%s %s\n' "$checksum" "work/openwrt/$file" | sha256sum --check
docker import --platform linux/arm64 "work/openwrt/$file" "e5-openwrt-base:$E5_WRT_VER"
python3 openwrt/tests/flash-diagnostics.py
python3 openwrt/tests/install-entrypoints.py
python3 openwrt/tests/hybrid-package.py
python3 devices/test_upstream_20261014.py
python3 tools/tests/android-bootchain.py
python3 openwrt/tests/block-probe.py
E5_TEST_IMAGE="e5-openwrt-base:$E5_WRT_VER" python3 openwrt/tests/gpt-plan.py
python3 openwrt/tests/voice-audio.py
E5_TEST_IMAGE="e5-openwrt-base:$E5_WRT_VER" python3 devices/t551m/test_screen_metadata.py -v
python3 openwrt/tests/dual-sms.py
python3 openwrt/tests/dual-sms-send.py
python3 openwrt/tests/sim-probe.py
E5_TEST_IMAGE="e5-openwrt-base:$E5_WRT_VER" python3 openwrt/tests/sim-lock.py
node openwrt/tests/luci-sim-slots.cjs
python3 magisk/tests.py
python3 rootfs/tests/sd-registry.py
python3 rootfs/tests/early-sd-firmware.py
E5_TEST_IMAGE="e5-openwrt-base:$E5_WRT_VER" python3 rootfs/tests/sd-write.py
python3 rootfs/tests/voice-state.py
python3 rootfs/tests/modem-coldboot.py
python3 tools/tests/ci-release.py
python3 tools/tests/openwrt-package-state.py
python3 ci/infoscreen-plugins/tools/check.py
if [ -f ci/infoscreen/tests/network-checks.sh ]; then
E5_TEST_IMAGE="e5-openwrt-base:$E5_WRT_VER" bash ci/infoscreen/tests/network-checks.sh
python3 ci/infoscreen/tests/usb-reset.py
fi
- name: Build ARM64 toolchain container
run: docker build -t e5-mainline-build upstream/
- name: Compile the release kernel
env:
E5_RELEASE: '1'
run: bash upstream/build.sh
- name: Restore patched OpenWrt packages
id: packages
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
out/openwrt/*.apk
out/openwrt/e5-modemmanager-build.json
out/native-screen/
key: patched-apk-${{ runner.os }}-${{ runner.arch }}-${{ env.E5_WRT_VER }}-${{ hashFiles('devices/common/build-screen-native.py', 'devices/common/infoscreen/native/*.c', 'devices/common/infoscreen/native/*.h', 'devices/common/infoscreen/native/*.py', 'devices/common/infoscreen/native/protocols/*.xml', 'openwrt/build-screen-wayland.sh', 'devices/t551m/test_screen_native.py', 'devices/t551m/test_screen_runtime.py', 'devices/t551m/test_screen_sanitizer.py', 'tools/build-layout.json', 'tools/openwrt-package-state.py', 'openwrt/tests/voice-identity.py', 'openwrt/tests/sim-power.py', 'openwrt/build-modemmanager.sh', 'openwrt/build-bluez.sh', 'openwrt/patches/**', 'rootfs/deb-patches/modemmanager-*.patch', 'rootfs/deb-patches/bluez-*.patch') }}
- name: Compile patched ModemManager and BlueZ
if: steps.packages.outputs.cache-hit != 'true'
run: |
bash openwrt/build-modemmanager.sh
bash openwrt/build-bluez.sh
sh openwrt/build-screen-wayland.sh
# Reuse its target SDK before the ephemeral runner removes it.
python3 devices/common/build-screen-native.py
python3 devices/t551m/test_screen_native.py
python3 devices/t551m/test_screen_runtime.py -v
python3 devices/t551m/test_screen_sanitizer.py
# This volume belongs to this ephemeral runner. Free it before image assembly.
docker volume rm e5-openwrt-src
- name: Save patched packages before image assembly
if: steps.packages.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
out/openwrt/*.apk
out/openwrt/e5-modemmanager-build.json
out/native-screen/
key: ${{ steps.packages.outputs.cache-primary-key }}
- name: Cache guarded block-mount APK
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: out/openwrt/block-mount-guarded.apk*
key: guarded-block-${{ env.E5_WRT_VER }}-${{ hashFiles('openwrt/build-block-mount*.sh', 'openwrt/block-mount.Dockerfile', 'openwrt/block-probe-guard.h', 'openwrt/patches/fstools-probe-device-types.patch') }}
- name: Build and test guarded block-mount
run: |
sh openwrt/build-block-mount.sh
E5_TEST_IMAGE="e5-openwrt-base:$E5_WRT_VER" E5_TEST_BLOCK_APK="$PWD/out/openwrt/block-mount-guarded.apk" python3 openwrt/tests/block-probe.py
- uses: actions/download-artifact@v4
with:
name: openwrt-installer-windows
path: installer/artifacts/windows
- uses: actions/download-artifact@v4
with:
name: openwrt-installer-macos-arm64
path: ${{ runner.temp }}/installer-macos
- name: Restore native macOS artifact
run: |
mkdir -p installer/artifacts/macos-arm64
tar -xzf "$RUNNER_TEMP/installer-macos/openwrt-installer-macos-arm64.tar.gz" -C installer/artifacts/macos-arm64
echo "OPENWRT_GUI_MACOS_ARTIFACT=$GITHUB_WORKSPACE/installer/artifacts/macos-arm64" >> "$GITHUB_ENV"
- name: Assemble the generic mainline flash bundles
env:
E5_MAINLINE: '1'
E5_TOOLS_BUILD_IMAGE: e5-mainline-build
run: |
set -o pipefail
export E5_INFOSCREEN="$GITHUB_WORKSPACE/ci/infoscreen"
export E5_INFOSCREEN_PLUGINS="$GITHUB_WORKSPACE/ci/infoscreen-plugins"
bash openwrt/make-flash-bundle.sh 2>&1 | tee out/release/bundle-build.log
- name: Package Android to Linux Magisk module
run: bash magisk/build.sh
- name: Validate release archives and sources
id: verify
run: python3 tools/ci-release.py verify
- name: Upload validated release files
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: flash-release-${{ github.run_id }}-${{ github.run_attempt }}
path: |
out/release/*.tar.gz
out/release/*.zip
out/release/SHA256SUMS
out/release/build.json
out/release/release-notes.md
compression-level: 0
if-no-files-found: error
- name: Upload build diagnostics
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: build-diagnostics-${{ github.run_id }}-${{ github.run_attempt }}
path: |
out/release/*.log
out/release/build.json
upstream/out-release/config
if-no-files-found: ignore
publish:
needs: build
if: github.event_name == 'push' || inputs.publish
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: flash-release-${{ github.run_id }}-${{ github.run_attempt }}
path: release
- name: Publish validated files through a draft release
working-directory: release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
AUTO_TAG: ${{ needs.build.outputs.tag }}
TITLE: ${{ needs.build.outputs.title }}
SOURCE: ${{ needs.build.outputs.source }}
EVENT: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
PRERELEASE: ${{ inputs.prerelease || false }}
run: |
sha256sum --check SHA256SUMS
tag="$AUTO_TAG"
if [ "$EVENT" = push ]; then tag="$REF_NAME"; fi
# Refuse to replace a published release; failed uploads may leave a draft.
if gh release view "$tag" --json isDraft >/dev/null 2>&1; then
[ "$(gh release view "$tag" --json isDraft --jq .isDraft)" = true ] || { echo '::error::Release already published; use a new tag or a manual build.'; exit 1; }
else
gh release create "$tag" --target "$SOURCE" --title "$TITLE" --notes-file release-notes.md --draft
fi
gh release upload "$tag" ./*.tar.gz ./*.zip SHA256SUMS build.json --clobber
args=(--draft=false --title "$TITLE" --notes-file release-notes.md)
if [ "$PRERELEASE" = true ]; then args+=(--prerelease --latest=false); else args+=(--prerelease=false --latest); fi
gh release edit "$tag" "${args[@]}"
gh release view "$tag" --json url --jq .url >> "$GITHUB_STEP_SUMMARY"