CI: Add forgejo CI
All checks were successful
PostmarketOS build / build (push) Successful in 9m15s

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
Vasiliy Doylov 2025-06-07 02:22:30 +03:00
parent 17fb415a08
commit 5b5c58d6dc
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582
2 changed files with 154 additions and 0 deletions

View file

@ -0,0 +1,34 @@
name: PostmarketOS build
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: Pmbootstrap
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Make temp package dir
run: mkdir -p /data/pmaports/temp/libcamera
- name: Copy APKBUILD to this dir
run: cp ${{ github.workspace }}/misc/APKBUILD /data/pmaports/temp/libcamera
- name: Clear local-built packages
run: pmbootstrap -y zap -p
- name: Run PostmarketOS build
run: pmbootstrap build --force libcamera --src ${{ github.workspace }} --arch aarch64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-files
path: /data/work/packages/edge/aarch64/*.apk
- name: Upload to package registry
run: >
for apk in /data/work/packages/edge/aarch64/*.apk ; do
echo -- Uploading $apk
curl -H "Authorization: token ${{secrets.PACKAGE_TOKEN}}" \
--upload-file $apk \
${{github.server_url}}/api/packages/${{github.repository_owner}}/alpine/edge/nightly
done
- name: Clean up
run: pmbootstrap -y zap -p

120
misc/APKBUILD Normal file
View file

@ -0,0 +1,120 @@
# Forked from Alpine for temporary downstream patches
pkgname=libcamera
_pkgver=0.5.0
pkgver=9999$_pkgver
pkgrel=1
pkgdesc="Linux camera framework"
url="https://libcamera.org/"
arch="all"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
depends_dev="
eudev-dev
glib-dev
gnutls-dev
gst-plugins-bad-dev
qt6-qtbase-dev
"
# upstream calls 'date' with a non-POSIX option so we pull in coreutils
makedepends="$depends_dev
coreutils
doxygen
graphviz
gtest-dev
libevent-dev
libpisp-dev
libunwind-dev
libyuv-dev
linux-headers
meson
py3-jinja2
py3-ply
py3-sphinx
py3-yaml
qt6-qttools-dev
yaml-dev
"
subpackages="
$pkgname-dbg
$pkgname-dev
$pkgname-doc
$pkgname-gstreamer
$pkgname-tools
"
source=""
builddir="$srcdir/$pkgname-v$_pkgver"
# gstreamer tests fail
# manual strip because ipa .sign files depend on the file contents- have to re-sign after strip
options="!strip !check"
case "$CARCH" in
arm*|aarch64)
subpackages="$subpackages"
;;
esac
case "$CARCH" in
ppc64le|s390x|riscv64|loongarch64)
# doesn't install any ipa
;;
*)
depends="$pkgname-ipa"
subpackages="$subpackages $pkgname-ipa"
;;
esac
build() {
abuild-meson \
-Dtest=false \
-Dv4l2=false \
-Dwerror=false \
-Dpipelines=simple \
-Dipas=simple \
. output
meson compile -C output
}
check() {
meson test -C output --print-errorlogs
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
# manual strip first..
scanelf --recursive \
--nobanner \
--etype "ET_DYN,ET_EXEC" \
--format "%F" \
"$pkgdir" \
| while read -r file; do
strip "$file"
done
}
ipa() {
depends=""
amove usr/lib/libcamera
# then sign ipa's
local ipa
for ipa in "$subpkgdir"/usr/lib/libcamera/ipa/ipa*.so; do
msg "signing $ipa"
"$builddir"/src/ipa/ipa-sign.sh \
"$(find "$builddir"/output -type f -iname "*ipa-priv-key.pem")" \
"$ipa" \
"$ipa".sign
done
}
gstreamer() {
depends=""
amove usr/lib/gstreamer-1.0
}
tools() {
depends=""
amove usr/bin/cam
amove usr/bin/lc-compliance
}
sha512sums=""