From 5ea8d2927c1850de7ebe4817514cd5745d9b64c7 Mon Sep 17 00:00:00 2001 From: nyyu Date: Thu, 8 Dec 2022 22:34:08 +0100 Subject: [PATCH] feat: woodpecker ci --- .woodpecker.yml | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ sync.sh | 19 ++++++----- 2 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..ae8f75a --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,85 @@ +variables: + - &build_vol '/media/fast/lineage/lineage-20.0:/build' + - &tools_vol '/media/fast/lineage/tools:/tools' + - &http_vol '/srv/http/drone:/http' + - &pub_vol '/mnt/android/lineage:/publish' + +matrix: + include: + - device: mondrianwifi + version: 20.0 + +pipeline: + sync: + pull: true + image: docker.nyyu.dev/lineage/android:latest + commands: + - HOME=/home/drone + - git config --global user.email 'drone@nyyu.dev' + - git config --global user.name 'drone' + - cd /build + - rm -rf .repo/repo + - repo init -u https://github.com/LineageOS-UL/android.git -b lineage-$version + - mkdir -p .repo/local_manifests + - cp $CI_WORKSPACE/$device.xml .repo/local_manifests/roomservice.xml + - bash $CI_WORKSPACE/sync.sh + volumes: + - *build_vol + when: + event: + - manual + - cron + build: + pull: true + image: docker.nyyu.dev/lineage/android:latest + commands: + - cd /build + - bash -c ". build/envsetup.sh && lunch lineage_$device-userdebug && mka bacon -j6" + volumes: + - *build_vol + - *tools_vol + when: + event: + - manual + - cron + copy: + pull: true + image: docker.nyyu.dev/lineage/android:latest + commands: + - rm -f /http/lineage-$version-*-UNOFFICIAL-$device.zip* + - mv -f /build/out/target/product/$device/lineage-$version-*-UNOFFICIAL-$device.zip* /http/ + - cat /build/changelog-$device-$version.md >> /http/changelog-$device-$version.md + - ls -lh /http/lineage-$version-*-UNOFFICIAL-$device.zip* + volumes: + - *build_vol + - *http_vol + when: + event: + - manual + - cron + clean: + pull: true + image: docker.nyyu.dev/lineage/android:latest + commands: + - rm -f /build/out/target/product/$device/lineage-$version-*-UNOFFICIAL-$device.zip_* /build/out/target/product/$device/lineage_$device-ota-eng.*.zip + - rm -f /build/changelog-$device-$version.md + volumes: + - *build_vol + when: + event: + - manual + - cron + publish: + pull: true + image: docker.nyyu.dev/lineage/android:latest + commands: + - mv /http/lineage-$version-*-UNOFFICIAL-$device.zip* /publish/$version/$device/ + - cat /http/changelog-$device-$version.md >> /publish/$version/$device/changelog.md + - rm -f /http/changelog-$device-$version.md + - ls -lh /publish/$version/$device/ + volumes: + - *http_vol + - *pub_vol + when: + event: + - deployment diff --git a/sync.sh b/sync.sh index 30aedc6..6dbebce 100644 --- a/sync.sh +++ b/sync.sh @@ -1,6 +1,9 @@ #!/bin/bash -e # shellcheck disable=SC2250,SC2154,SC2086,SC1091,SC2312 +if [[ -z "$CI_WORKSPACE" ]]; then + CI_WORKSPACE=$DRONE_WORKSPACE_BASE +fi TOPDIR=$(pwd) changelog=${TOPDIR}/changelog-${device}-${version}.md @@ -38,28 +41,28 @@ cat "${changelog}" . build/envsetup.sh cd packages/apps/LineageParts -git am $DRONE_WORKSPACE_BASE/fix-always-enable-taskbar-toggle.patch || git am --abort +git am $CI_WORKSPACE/fix-always-enable-taskbar-toggle.patch || git am --abort cd $TOPDIR cd packages/apps/Trebuchet -git am $DRONE_WORKSPACE_BASE/fix-enable-more-grids-for-tablet.patch || git am --abort +git am $CI_WORKSPACE/fix-enable-more-grids-for-tablet.patch || git am --abort cd $TOPDIR #bluetooth cd packages/modules/Bluetooth -git am $DRONE_WORKSPACE_BASE/fix-bt-1.patch || git am --abort -git am $DRONE_WORKSPACE_BASE/fix-bt-2.patch || git am --abort -git am $DRONE_WORKSPACE_BASE/fix-bt-3.patch || git am --abort -git am $DRONE_WORKSPACE_BASE/fix-bt-le.patch || git am --abort +git am $CI_WORKSPACE/fix-bt-1.patch || git am --abort +git am $CI_WORKSPACE/fix-bt-2.patch || git am --abort +git am $CI_WORKSPACE/fix-bt-3.patch || git am --abort +git am $CI_WORKSPACE/fix-bt-le.patch || git am --abort cd $TOPDIR #connectivity cd packages/modules/Connectivity -git am $DRONE_WORKSPACE_BASE/fix-NetworkStats-disable-BPF.patch || git am --abort +git am $CI_WORKSPACE/fix-NetworkStats-disable-BPF.patch || git am --abort cd $TOPDIR #av cd frameworks/av -git am $DRONE_WORKSPACE_BASE/fix-rear-camera-rotation.patch || git am --abort +git am $CI_WORKSPACE/fix-rear-camera-rotation.patch || git am --abort cd $TOPDIR #safetynet