Skip to content

Commit 24ac5c4

Browse files
committed
Add APKBUILD CI job and apkbuild-lint to checks
1 parent d613822 commit 24ac5c4

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107
- name: Run checks
108108
run: just check
109109

110+
110111
# Cross-compiled debug builds to verify compilation on all target architectures
111112
build:
112113
name: Build (${{ matrix.arch }})
@@ -214,6 +215,74 @@ jobs:
214215
just build-debug --target ${{ matrix.target }}
215216
fi
216217
218+
apkbuild:
219+
name: APKBUILD
220+
runs-on: ubuntu-latest
221+
needs: check
222+
container:
223+
image: alpine:edge
224+
steps:
225+
- name: Install build dependencies
226+
run: |
227+
apk add --no-cache \
228+
alpine-sdk sudo git atools \
229+
cargo \
230+
clang-libclang \
231+
cmake \
232+
eudev-dev \
233+
glib-dev \
234+
gst-plugins-bad-dev \
235+
gst-plugins-base-dev \
236+
gstreamer-dev \
237+
just \
238+
libcamera-dev \
239+
libinput-dev \
240+
libseat-dev \
241+
libxkbcommon-dev \
242+
nasm \
243+
pkgconf \
244+
wayland-dev
245+
246+
- name: Set up abuild
247+
run: |
248+
adduser -D builder
249+
addgroup builder abuild
250+
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
251+
su builder -c "abuild-keygen -a -n"
252+
253+
- name: Checkout repository
254+
uses: actions/checkout@v6
255+
with:
256+
fetch-tags: true
257+
258+
- name: Generate APKBUILD and source tarball
259+
run: |
260+
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
261+
262+
# Create source tarball matching GitHub's archive format
263+
mkdir -p /tmp/src/camera-$VERSION
264+
cp -a . /tmp/src/camera-$VERSION/
265+
cd /tmp/src
266+
tar czf camera-$VERSION.tar.gz camera-$VERSION
267+
CHECKSUM=$(sha512sum camera-$VERSION.tar.gz | awk '{print $1}')
268+
269+
# Generate APKBUILD from template with local file source
270+
mkdir -p /tmp/apkbuild
271+
sed -e "s/@@VERSION@@/$VERSION/g" \
272+
-e "s/@@CHECKSUM@@/$CHECKSUM/g" \
273+
$GITHUB_WORKSPACE/.github/APKBUILD.template > /tmp/apkbuild/APKBUILD
274+
sed -i "s|source=.*|source=\"camera-$VERSION.tar.gz::file:///tmp/src/camera-$VERSION.tar.gz\"|" /tmp/apkbuild/APKBUILD
275+
276+
chown -R builder:builder /tmp/apkbuild /tmp/src
277+
278+
- name: Lint APKBUILD
279+
run: apkbuild-lint /tmp/apkbuild/APKBUILD
280+
281+
- name: Build package
282+
run: |
283+
cd /tmp/apkbuild
284+
su builder -c "abuild -r"
285+
217286
flatpak-x86_64:
218287
name: Flatpak (x86_64)
219288
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)