add changelog

This commit is contained in:
nyyu 2022-08-22 17:51:08 +02:00
parent 410e393f97
commit 41825856c6
2 changed files with 37 additions and 5 deletions

View File

@ -16,7 +16,7 @@ steps:
- repo init -u https://github.com/LineageOS-UL/android.git -b lineage-$version - repo init -u https://github.com/LineageOS-UL/android.git -b lineage-$version
- mkdir -p .repo/local_manifests - mkdir -p .repo/local_manifests
- cp $DRONE_WORKSPACE_BASE/$device.xml .repo/local_manifests/roomservice.xml - cp $DRONE_WORKSPACE_BASE/$device.xml .repo/local_manifests/roomservice.xml
- repo sync -q -c -j 6 --fail-fast --force-sync --no-tags - bash $DRONE_WORKSPACE_BASE/sync.sh
volumes: volumes:
- name: build - name: build
path: /build path: /build
@ -35,6 +35,7 @@ steps:
commands: commands:
- rm -f /http/lineage-$version-*-UNOFFICIAL-$device.zip* - rm -f /http/lineage-$version-*-UNOFFICIAL-$device.zip*
- mv -f /build/out/target/product/$device/lineage-$version-*-UNOFFICIAL-$device.zip* /http/ - 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* - ls -lh /http/lineage-$version-*-UNOFFICIAL-$device.zip*
volumes: volumes:
- name: build - name: build
@ -45,8 +46,8 @@ steps:
pull: always pull: always
image: docker.nyyu.dev/lineage/android:latest image: docker.nyyu.dev/lineage/android:latest
commands: commands:
- cd /build - rm -f /build/out/target/product/$device/lineage-$version-*-UNOFFICIAL-$device.zip_* /build/out/target/product/$device/lineage_$device-ota-eng.*.zip
- rm -f out/target/product/$device/lineage-$version-*-UNOFFICIAL-$device.zip_* out/target/product/$device/lineage_$device-ota-eng.*.zip - rm -f /build/changelog_${device}_${version}.md
volumes: volumes:
- name: build - name: build
path: /build path: /build
@ -82,8 +83,8 @@ steps:
pull: always pull: always
image: docker.nyyu.dev/lineage/android:latest image: docker.nyyu.dev/lineage/android:latest
commands: commands:
- cd /http - mv /http/lineage-$version-*-UNOFFICIAL-$device.zip* /publish/$version/$device/
- mv lineage-$version-*-UNOFFICIAL-$device.zip* /publish/$version/$device/ - cat /http/changelog_${device}_${version}.md >> /publish/$version/$device/changelog.md
- ls -lh /publish/$version/$device/ - ls -lh /publish/$version/$device/
volumes: volumes:
- name: http - name: http

31
sync.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
TOPDIR=$(pwd)
changelog=${TOPDIR}/changelog_${device}_${version}.md
declare -A before
tmp=($(repo forall -c 'echo "${REPO_PATH}:$(git rev-parse HEAD)"'))
for i in "${tmp[@]}"; do
IFS=: read -r folder commit <<<"${i}"
before[${folder}]=${commit}
done
repo sync -q -c -j 6 --fail-fast --force-sync --no-tags
echo -e "# Build $(date '+%Y-%m-%d %H:%M:%S') UTC\n" >>"${changelog}"
tmp=($(repo forall -c 'echo "${REPO_PATH}:$(git rev-parse HEAD)"'))
for i in "${tmp[@]}"; do
IFS=: read -r folder commit <<<"${i}"
if [[ "${before[${folder}]}" != "${commit}" ]]; then
cd ${folder}
{
echo "## ${folder}"
git --no-pager log --pretty=format:"- %s" "${before[${folder}]}".."${commit}"
echo
} >>"${changelog}"
cd ${TOPDIR}
fi
done
echo -e "\n" >>"${changelog}"
cat "${changelog}"