mirror of https://github.com/OpenIPC/firmware.git
CI: Refactor NAND/NOR images handling
parent
b702f468cf
commit
5cc973fb90
|
@ -388,11 +388,6 @@ jobs:
|
|||
BOARD="${BOARD}_openipc"
|
||||
fi
|
||||
|
||||
NORFW_PATH="${GITHUB_WORKSPACE}/output/images/openipc.${{ matrix.platform }}-${SUFF}br.tgz"
|
||||
echo "NORFW_PATH=$NORFW_PATH" >> $GITHUB_ENV
|
||||
NORFW_FILE=$(basename $NORFW_PATH)
|
||||
echo "NORFW_FILE=$NORFW_FILE" >> $GITHUB_ENV
|
||||
|
||||
CONF_PATH=$(find . -name "${BOARD}_defconfig")
|
||||
|
||||
echo Using $TOOLNAME
|
||||
|
@ -444,14 +439,13 @@ jobs:
|
|||
mkdir /tmp/extsdk
|
||||
tar xvf ${TOOLNAME}.tgz --strip-components=1 -C /tmp/extsdk >/dev/null
|
||||
|
||||
HAS_NAND=$(make BOARD=${BOARD} has-nand)
|
||||
echo "HAS_NAND=$HAS_NAND" >> $GITHUB_ENV
|
||||
|
||||
make BOARD=$BOARD all
|
||||
|
||||
IMAGES_DIR=${GITHUB_WORKSPACE}/output/images
|
||||
pushd output/images
|
||||
check_exceeded() {
|
||||
ACTUAL=$(stat --printf="%s" ${1})
|
||||
echo Debug ${1}: ${ACTUAL} vs ${2}...
|
||||
if [[ ${ACTUAL} -gt ${2} ]]; then
|
||||
OVERRUN=$((${ACTUAL}-${2}))
|
||||
echo "TG_NOTIFY=Warning, ${1} size exceeded by ${OVERRUN}... ${{ matrix.platform }} (${{ matrix.release }})" >> $GITHUB_ENV
|
||||
|
@ -459,17 +453,25 @@ jobs:
|
|||
fi
|
||||
}
|
||||
|
||||
check_exceeded uImage ${MAX_UIMAGE_LITE}
|
||||
check_exceeded rootfs.squashfs ${MAX_ROOTFS_LITE}
|
||||
if [ -f rootfs.squashfs ]; then
|
||||
# TODO: check why it doesn't fail on fpv rootfs?
|
||||
check_exceeded uImage ${MAX_UIMAGE_LITE}
|
||||
check_exceeded rootfs.squashfs ${MAX_ROOTFS_LITE}
|
||||
|
||||
md5sum uImage > uImage.${{ matrix.platform }}.md5sum
|
||||
mv uImage uImage.${{ matrix.platform }}
|
||||
md5sum rootfs.squashfs > rootfs.squashfs.${{ matrix.platform }}.md5sum
|
||||
mv rootfs.squashfs rootfs.squashfs.${{ matrix.platform }}
|
||||
tar -cvzf $NORFW_PATH uImage* *rootfs.squashfs.${{ matrix.platform }}*
|
||||
NORFW_PATH="${IMAGES_DIR}/openipc.${{ matrix.platform }}-${SUFF}br.tgz"
|
||||
echo "NORFW_PATH=$NORFW_PATH" >> $GITHUB_ENV
|
||||
NORFW_FILE=$(basename $NORFW_PATH)
|
||||
echo "NORFW_FILE=$NORFW_FILE" >> $GITHUB_ENV
|
||||
|
||||
if [ "$HAS_NAND" == "y" ]; then
|
||||
NANDFW_PATH="${GITHUB_WORKSPACE}/output/images/openipc.${{ matrix.platform }}-nand-br.tgz"
|
||||
md5sum uImage > uImage.${{ matrix.platform }}.md5sum
|
||||
mv uImage uImage.${{ matrix.platform }}
|
||||
md5sum rootfs.squashfs > rootfs.squashfs.${{ matrix.platform }}.md5sum
|
||||
mv rootfs.squashfs rootfs.squashfs.${{ matrix.platform }}
|
||||
tar -cvzf $NORFW_PATH uImage* *rootfs.squashfs.${{ matrix.platform }}*
|
||||
fi
|
||||
|
||||
if [ -f rootfs.ubifs ]; then
|
||||
NANDFW_PATH="${IMAGES_DIR}/openipc.${{ matrix.platform }}-nand-br.tgz"
|
||||
echo "NANDFW_PATH=$NANDFW_PATH" >> $GITHUB_ENV
|
||||
NANDFW_FILE=$(basename $NANDFW_PATH)
|
||||
echo "NANDFW_FILE=$NANDFW_FILE" >> $GITHUB_ENV
|
||||
|
@ -507,7 +509,7 @@ jobs:
|
|||
prerelease: ${{ env.PRERELEASE }}
|
||||
|
||||
- name: Upload NOR FW to release
|
||||
if: ${{ !env.ACT && github.event_name != 'pull_request' && matrix.custom != 'onlyci' }}
|
||||
if: ${{ !env.ACT && github.event_name != 'pull_request' && matrix.custom != 'onlyci' && env.NORFW_FILE != '' }}
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@ -517,7 +519,7 @@ jobs:
|
|||
overwrite: true
|
||||
|
||||
- name: Upload NAND FW to release
|
||||
if: ${{ !env.ACT && github.event_name != 'pull_request' && matrix.custom != 'onlyci' && env.HAS_NAND == 'y' }}
|
||||
if: ${{ !env.ACT && github.event_name != 'pull_request' && matrix.custom != 'onlyci' && env.NANDFW_FILE != '' }}
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
Loading…
Reference in New Issue