Skip to content

Commit f9083c0

Browse files
joshschmelzleclaude
andcommitted
Target rpi-7.1.y kernel for Debian trixie with packagecloud deploy
- KERNEL_BRANCH rpi-6.19.y -> rpi-7.1.y; DEBIAN_RELEASE defaults to trixie on this branch, producing wlanpi-kernel-trixie-v8/-2712 - Workflow: add distro choice input (default trixie), wire it to DEBIAN_RELEASE (the env vars it replaced were never read by build-kernel.sh), and parameterize artifact names by release - Add packagecloud upload step to wlanpi/dev debian/$DEBIAN_RELEASE using the package_cloud CLI directly, verifying each push reports success (the CLI exits 0 on errors, which has produced green runs that uploaded nothing) - Fail the build if no .deb is produced; push trigger follows this branch Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5b1ea84 commit f9083c0

2 files changed

Lines changed: 63 additions & 22 deletions

File tree

.github/workflows/build-and-archive-kernel-package.yml

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Build and archive WLAN Pi kernel package
33
on:
44
push:
55
branches:
6-
- 6.12-bookworm
6+
- 7.1-trixie
77
paths:
88
- 'patches/**'
99
- 'wlanpi_*_defconfig'
1010
- 'build-kernel*.sh'
11+
- '.github/workflows/build-and-archive-kernel-package.yml'
1112
workflow_dispatch:
1213
inputs:
1314
build_target:
@@ -19,16 +20,29 @@ on:
1920
- both
2021
- v8
2122
- 2712
23+
distro:
24+
description: 'Target Debian release'
25+
required: true
26+
default: 'trixie'
27+
type: choice
28+
options:
29+
- trixie
30+
- bookworm
31+
upload_to_packagecloud:
32+
description: 'Upload built packages to packagecloud wlanpi/dev'
33+
required: true
34+
default: true
35+
type: boolean
2236

2337
jobs:
2438
build:
2539
runs-on: ubuntu-24.04-arm
2640

41+
environment: PACKAGECLOUD
42+
2743
env:
28-
DISTRO: bookworm
29-
VERSION_CODENAME: bookworm
30-
KERNEL_TARGET_DISTRO: Debian
31-
KERNEL_TARGET_VERSION: bookworm
44+
# DEBIAN_RELEASE drives package naming in build-kernel.sh
45+
DEBIAN_RELEASE: ${{ github.event.inputs.distro || 'trixie' }}
3246
# Set BUILD_TARGET from workflow input, default to 'both' for push events
3347
BUILD_TARGET: ${{ github.event.inputs.build_target || 'both' }}
3448

@@ -87,7 +101,7 @@ jobs:
87101
exit 1
88102
fi
89103
fi
90-
104+
91105
if [[ "$BUILD_TARGET" == "2712" || "$BUILD_TARGET" == "both" ]]; then
92106
if [ -f wlanpi_2712_defconfig ]; then
93107
echo "✓ wlanpi_2712_defconfig found"
@@ -119,51 +133,78 @@ jobs:
119133
echo "Built packages:"
120134
find output -name '*.deb' -type f -exec basename {} \;
121135
136+
if [ -z "$(find output -maxdepth 1 -name '*.deb' -print -quit)" ]; then
137+
echo "ERROR: no .deb packages were produced"
138+
exit 1
139+
fi
140+
122141
# Step 10: Upload v8 kernel package
123142
- name: Upload v8 kernel package
124143
if: ${{ env.BUILD_TARGET == 'v8' || env.BUILD_TARGET == 'both' }}
125144
uses: actions/upload-artifact@v4
126145
with:
127-
name: wlanpi-kernel-bookworm-v8
128-
path: output/wlanpi-kernel-bookworm-v8_*.deb
146+
name: wlanpi-kernel-${{ env.DEBIAN_RELEASE }}-v8
147+
path: output/wlanpi-kernel-${{ env.DEBIAN_RELEASE }}-v8_*.deb
129148
if-no-files-found: warn
130149

131150
# Step 11: Upload v8 headers package
132151
- name: Upload v8 headers package
133152
if: ${{ env.BUILD_TARGET == 'v8' || env.BUILD_TARGET == 'both' }}
134153
uses: actions/upload-artifact@v4
135154
with:
136-
name: wlanpi-kernel-headers-bookworm-v8
137-
path: output/wlanpi-kernel-headers-bookworm-v8_*.deb
155+
name: wlanpi-kernel-headers-${{ env.DEBIAN_RELEASE }}-v8
156+
path: output/wlanpi-kernel-headers-${{ env.DEBIAN_RELEASE }}-v8_*.deb
138157
if-no-files-found: warn
139158

140159
# Step 12: Upload 2712 kernel package
141160
- name: Upload 2712 Kernel Package
142161
if: ${{ env.BUILD_TARGET == '2712' || env.BUILD_TARGET == 'both' }}
143162
uses: actions/upload-artifact@v4
144163
with:
145-
name: wlanpi-kernel-bookworm-2712
146-
path: output/wlanpi-kernel-bookworm-2712_*.deb
164+
name: wlanpi-kernel-${{ env.DEBIAN_RELEASE }}-2712
165+
path: output/wlanpi-kernel-${{ env.DEBIAN_RELEASE }}-2712_*.deb
147166
if-no-files-found: warn
148167

149168
# Step 13: Upload 2712 headers package
150169
- name: Upload 2712 headers package
151170
if: ${{ env.BUILD_TARGET == '2712' || env.BUILD_TARGET == 'both' }}
152171
uses: actions/upload-artifact@v4
153172
with:
154-
name: wlanpi-kernel-headers-bookworm-2712
155-
path: output/wlanpi-kernel-headers-bookworm-2712_*.deb
173+
name: wlanpi-kernel-headers-${{ env.DEBIAN_RELEASE }}-2712
174+
path: output/wlanpi-kernel-headers-${{ env.DEBIAN_RELEASE }}-2712_*.deb
156175
if-no-files-found: warn
157176

158177
# Step 14: Upload dual kernel package
159178
- name: Upload dual kernel package
160179
if: ${{ env.BUILD_TARGET == 'both' }}
161180
uses: actions/upload-artifact@v4
162181
with:
163-
name: wlanpi-kernel-bookworm-dual
164-
path: output/wlanpi-kernel-bookworm_*.deb
182+
name: wlanpi-kernel-${{ env.DEBIAN_RELEASE }}-dual
183+
path: output/wlanpi-kernel-${{ env.DEBIAN_RELEASE }}_*.deb
165184
if-no-files-found: warn
166185

186+
# Step 15: Upload packages to packagecloud wlanpi/dev debian/DEBIAN_RELEASE.
187+
# Uses the package_cloud CLI directly instead of an action so we can detect
188+
# upload errors: the CLI exits 0 even when a push fails (Thor bug), which
189+
# has produced green runs that uploaded nothing.
190+
- name: Upload packages to packagecloud debian/${{ env.DEBIAN_RELEASE }}
191+
if: ${{ (github.event_name == 'push' || github.event.inputs.upload_to_packagecloud == 'true') && (github.repository_owner == 'WLAN-Pi') }}
192+
env:
193+
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
194+
run: |
195+
sudo gem install package_cloud
196+
status=0
197+
for deb in output/*.deb; do
198+
echo "Pushing ${deb} to wlanpi/dev/debian/${DEBIAN_RELEASE}"
199+
out=$(package_cloud push "wlanpi/dev/debian/${DEBIAN_RELEASE}" "$deb" 2>&1) || status=1
200+
echo "$out"
201+
if ! echo "$out" | grep -q "success!"; then
202+
echo "::error::Upload of ${deb} to debian/${DEBIAN_RELEASE} did not report success"
203+
status=1
204+
fi
205+
done
206+
exit $status
207+
167208
slack-workflow-status:
168209
if: ${{ always() && (github.repository_owner == 'WLAN-Pi') && (! github.event.pull_request.head.repo.fork) }}
169210
name: Post Workflow Status to Slack

build-kernel.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
#
1515
# Environment variables:
1616
# BUILD_TARGET - Same as TARGET argument (env overrides CLI arg)
17-
# DEBIAN_RELEASE - Target Debian release: bookworm (default), trixie
17+
# DEBIAN_RELEASE - Target Debian release: trixie (default), bookworm
1818
# CI - Set to 'true' to indicate CI environment
1919
#
2020
# Examples:
21-
# ./build-kernel.sh # Build both kernels for bookworm
22-
# ./build-kernel.sh v8 # Build v8 only for bookworm
21+
# ./build-kernel.sh # Build both kernels for trixie
22+
# ./build-kernel.sh v8 # Build v8 only for trixie
2323
# BUILD_TARGET=2712 ./build-kernel.sh # Build 2712 via env var
2424
# DEBIAN_RELEASE=trixie ./build-kernel.sh # Build for Trixie
2525
# DEBIAN_RELEASE=trixie ./build-kernel.sh v8 # Build v8 for Trixie
2626

2727
set -euo pipefail # Enable strict error handling
2828

2929
# Debian release selection (for local testing of different releases)
30-
DEBIAN_RELEASE="${DEBIAN_RELEASE:-bookworm}"
30+
DEBIAN_RELEASE="${DEBIAN_RELEASE:-trixie}"
3131

3232
# Support both CLI args and environment variables (env takes precedence for CI)
3333
BUILD_TARGET="${BUILD_TARGET:-${1:-both}}"
@@ -55,7 +55,7 @@ case "$BUILD_TARGET" in
5555
echo ""
5656
echo "Environment variables:"
5757
echo " BUILD_TARGET - Override target selection (for CI)"
58-
echo " DEBIAN_RELEASE - Target Debian release: bookworm (default), trixie"
58+
echo " DEBIAN_RELEASE - Target Debian release: trixie (default), bookworm"
5959
echo ""
6060
echo "Examples:"
6161
echo " DEBIAN_RELEASE=trixie ./build-kernel.sh v8"
@@ -121,7 +121,7 @@ echo ""
121121

122122
# Configuration Variables
123123
KERNEL_REPO="https://github.com/raspberrypi/linux.git"
124-
KERNEL_BRANCH="rpi-6.19.y"
124+
KERNEL_BRANCH="rpi-7.1.y"
125125
KERNEL_SRC_DIR="$BASE_DIR/linux"
126126
OUTPUT_PATH="$BASE_DIR/output"
127127
CROSS_COMPILE="aarch64-linux-gnu-"

0 commit comments

Comments
 (0)