Skip to content

Commit bff3d57

Browse files
refactor(ci): use standalone mode
Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
1 parent 0b3d2a8 commit bff3d57

1 file changed

Lines changed: 34 additions & 30 deletions

File tree

.github/scripts/build-ci.sh

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ SCRIPT_DIR="$(dirname -- "${BASH_SOURCE[0]}")"
66

77
source "$SCRIPT_DIR/functions.sh"
88

9-
BUILD="$(mktemp -d)"
9+
PKGDIR="$(mktemp -d)"
1010
ARTIFACT="$WORKSPACE/build"
1111

12-
mkdir -p "$BUILD/output"
1312
mkdir -p "$ARTIFACT"
1413

1514
trap 'rm -rf '"$BUILD" EXIT
@@ -18,61 +17,66 @@ cd "$BUILD"
1817

1918
case "${1:-}" in
2019
make)
21-
cmake "$WORKSPACE"
20+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON
2221
make -j
23-
copy-license "$BUILD/output"
24-
copy-usage "$BUILD/output"
25-
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE.zip" "$BUILD/output"
22+
make DESTDIR="$PKGDIR" install
23+
copy-license "$PKGDIR/executables"
24+
copy-usage "$PKGDIR/executables"
25+
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE.zip" "$PKGDIR/executables"
2626
;;
2727
make-qmi)
28-
cmake "$WORKSPACE" -DLPAC_WITH_APDU_QMI=ON -DLPAC_WITH_APDU_QMI_QRTR=ON -DLPAC_WITH_APDU_MBIM=ON
28+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON -DLPAC_WITH_APDU_QMI=ON -DLPAC_WITH_APDU_QMI_QRTR=ON -DLPAC_WITH_APDU_MBIM=ON
2929
make -j
30-
copy-license "$BUILD/output"
31-
copy-usage "$BUILD/output"
32-
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE-with-qmi.zip" "$BUILD/output"
30+
make DESTDIR="$PKGDIR" install
31+
copy-license "$PKGDIR/executables"
32+
copy-usage "$PKGDIR/executables"
33+
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE-with-qmi.zip" "$PKGDIR/executables"
3334
;;
3435
make-gbinder)
35-
cmake "$WORKSPACE" -DLPAC_WITH_APDU_GBINDER=ON
36+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON -DLPAC_WITH_APDU_GBINDER=ON
3637
make -j
37-
copy-license "$BUILD/output"
38-
copy-usage "$BUILD/output"
39-
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE-with-gbinder.zip" "$BUILD/output"
38+
make DESTDIR="$PKGDIR" install
39+
copy-license "$PKGDIR/executables"
40+
copy-usage "$PKGDIR/executables"
41+
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE-with-gbinder.zip" "$PKGDIR/executables"
4042
;;
4143
make-without-lto)
42-
cmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF "$WORKSPACE"
44+
cmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF -DSTANDALONE_MODE=ON "$PKGDIR/executables"
4345
make -j
44-
copy-license "$BUILD/output"
45-
copy-usage "$BUILD/output"
46-
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE-without-lto.zip" "$BUILD/output"
46+
make DESTDIR="$PKGDIR" install
47+
copy-license "$PKGDIR/executables"
48+
copy-usage "$PKGDIR/executables"
49+
create-bundle "$ARTIFACT/lpac-$KERNEL-$MACHINE-without-lto.zip" "$PKGDIR/executables"
4750
;;
4851
debian)
4952
cmake "$WORKSPACE" -DCPACK_GENERATOR=DEB
5053
make -j package
5154
cp lpac_*.deb "$ARTIFACT"
5255
;;
5356
mingw)
54-
cmake "$WORKSPACE" -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64.cmake
57+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64.cmake
5558
make -j
56-
copy-license "$BUILD/output"
59+
make DESTDIR="$PKGDIR" install
5760
copy-curl-win "$BUILD/output"
58-
copy-usage "$BUILD/output"
59-
create-bundle "$ARTIFACT/lpac-windows-x86_64-mingw.zip" "$BUILD/output"
61+
copy-license "$PKGDIR/executables"
62+
copy-usage "$PKGDIR/executables"
63+
create-bundle "$ARTIFACT/lpac-windows-x86_64-mingw.zip" "$PKGDIR/executables"
6064
;;
6165
woa-mingw)
62-
cmake "$WORKSPACE" -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64-woa.cmake
66+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64-woa.cmake
6367
make -j
64-
copy-license "$BUILD/output"
6568
copy-curl-woa "$BUILD/output"
66-
copy-usage "$BUILD/output"
67-
create-bundle "$ARTIFACT/lpac-windows-arm64-mingw.zip" "$BUILD/output"
69+
copy-license "$PKGDIR/executables"
70+
copy-usage "$PKGDIR/executables"
71+
create-bundle "$ARTIFACT/lpac-windows-arm64-mingw.zip" "$PKGDIR/executables"
6872
;;
6973
woa-zig)
70-
cmake "$WORKSPACE" -DCMAKE_TOOLCHAIN_FILE=./cmake/aarch64-windows-zig.cmake
74+
cmake "$WORKSPACE" -DSTANDALONE_MODE=ON -DCMAKE_TOOLCHAIN_FILE=./cmake/aarch64-windows-zig.cmake
7175
make -j
72-
copy-license "$BUILD/output"
7376
copy-curl-woa "$BUILD/output"
74-
copy-usage "$BUILD/output"
75-
create-bundle "$ARTIFACT/lpac-windows-arm64-zig.zip" "$BUILD/output"
77+
copy-license "$PKGDIR/executables"
78+
copy-usage "$PKGDIR/executables"
79+
create-bundle "$ARTIFACT/lpac-windows-arm64-zig.zip" "$PKGDIR/executables"
7680
;;
7781
*)
7882
echo "Usage: $0 {make,debian,mingw,woa-mingw,woa-zig}"

0 commit comments

Comments
 (0)