mirror of https://github.com/OpenIPC/firmware.git
589 lines
19 KiB
YAML
589 lines
19 KiB
YAML
name: build
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- synchronize
|
|
- reopened
|
|
- opened
|
|
paths-ignore:
|
|
- '**.md'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
tags:
|
|
- 'v*'
|
|
paths-ignore:
|
|
- '**.md'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
MAX_KERNEL_SIZE: 0x200000
|
|
MAX_ROOTFS_SIZE: 0x500000
|
|
MAX_KERNEL_SIZE_ULTIMATE: 0x300000
|
|
MAX_ROOTFS_SIZE_ULTIMATE: 0xa00000
|
|
TG_OPTIONS: -s --connect-timeout 30 --retry 10 --http1.1 --verbose
|
|
|
|
jobs:
|
|
toolchain:
|
|
name: Toolchain
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NEED: true
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- ak3918ev300
|
|
- fh8852v100
|
|
- fh8852v200
|
|
- gk7102
|
|
- gm8136
|
|
- hi3516cv100
|
|
- hi3516cv200
|
|
- hi3516cv300
|
|
- hi3516cv500
|
|
- hi3516ev200
|
|
- hi3519v101
|
|
- hi3536cv100
|
|
- msc313e
|
|
- msc316dc
|
|
- msc316dm
|
|
- nt98562
|
|
- rv1126
|
|
- s3l
|
|
- ssc335
|
|
- t31
|
|
- xm510
|
|
- xm530
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
|
|
|
- name: Determine toolchain name and can we skip build
|
|
run: |
|
|
HEAD_TAG=$(git tag --points-at HEAD)
|
|
GIT_HASH=$(git rev-parse --short $GITHUB_SHA)
|
|
if [ -z "$HEAD_TAG" ]; then
|
|
TAG_NAME="latest"
|
|
RELEASE_NAME="Development Build"
|
|
PRERELEASE=true
|
|
else
|
|
TAG_NAME=${{ github.ref }}
|
|
RELEASE_NAME="Release ${{ github.ref }}"
|
|
PRERELEASE=false
|
|
fi
|
|
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
|
|
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
|
|
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
|
|
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
|
|
|
|
BOARD=unknown_unknown_${{ matrix.platform }}_openipc
|
|
make BOARD=$BOARD prepare
|
|
TOOLNAME=$(make BOARD=$BOARD toolname)
|
|
echo "TOOLNAME=$TOOLNAME" >> $GITHUB_ENV
|
|
URL=https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/${TOOLNAME}.tgz
|
|
echo Checking $URL
|
|
|
|
HTTP_CODE=$(curl -o /dev/null --silent -Iw '%{http_code}' $URL)
|
|
echo GitHub returned HTTP code: ${HTTP_CODE}
|
|
if [ "$HTTP_CODE" == "302" ]; then
|
|
echo "NEED=false" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Install build dependencies
|
|
if: env.NEED == 'true'
|
|
run: |
|
|
sudo make install-deps
|
|
if [ ! -z "$ACT" ]; then
|
|
echo "FORCE_UNSAFE_CONFIGURE=1" >> $GITHUB_ENV
|
|
else
|
|
# https://github.com/actions/runner-images/issues/2577
|
|
echo "1.1.1.1 invisible-mirror.net" | sudo tee -a /etc/hosts
|
|
fi
|
|
|
|
- name: Free disk space
|
|
if: ${{ !env.ACT && env.NEED == 'true' }}
|
|
run: |
|
|
sudo apt clean
|
|
docker rmi $(docker image ls -aq)
|
|
|
|
- name: Build Buildroot SDK
|
|
if: env.NEED == 'true'
|
|
run: |
|
|
make BOARD=unknown_unknown_${{ matrix.platform }}_openipc br-sdk
|
|
SDK_PATH=$(find output/images -name "*_sdk-buildroot.tar.gz")
|
|
# Why do we need this crap (only for weird artifact names)?
|
|
NEW="$(dirname $SDK_PATH)/${TOOLNAME}.tgz"
|
|
mv $SDK_PATH $NEW
|
|
SDK_PATH=$NEW
|
|
echo "SDK_PATH=$SDK_PATH" >> $GITHUB_ENV
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
# uncomment one of the options:
|
|
# 1. Build only there is no such toolchain
|
|
if: env.NEED == 'true'
|
|
with:
|
|
name: '${{ env.TOOLNAME }}.tgz'
|
|
path: ${{ env.SDK_PATH }}
|
|
retention-days: 1
|
|
|
|
- name: Create release
|
|
if: ${{ !env.ACT && github.event_name != 'pull_request' && env.NEED == 'true' }}
|
|
uses: actions/create-release@v1
|
|
continue-on-error: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ env.TAG_NAME }}
|
|
release_name: ${{ env.RELEASE_NAME }}
|
|
draft: false
|
|
prerelease: ${{ env.PRERELEASE }}
|
|
|
|
- name: Upload SDK to release
|
|
if: ${{ !env.ACT && github.event_name != 'pull_request' && env.NEED == 'true' }}
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ${{ env.SDK_PATH }}
|
|
asset_name: '${{ env.TOOLNAME }}.tgz'
|
|
tag: ${{ env.TAG_NAME }}
|
|
overwrite: true
|
|
|
|
buildroot:
|
|
name: Firmware
|
|
needs: toolchain
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
FURRY: ${{ secrets.FURRY }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- hi3516cv100
|
|
- hi3518cv100
|
|
- hi3518ev100
|
|
- hi3516av100
|
|
- hi3516dv100
|
|
- hi3516cv200
|
|
- hi3518ev200
|
|
- hi3519v101
|
|
- hi3516av200
|
|
- hi3516cv300
|
|
- hi3516ev100
|
|
- hi3516cv500
|
|
- hi3516dv300
|
|
- hi3516av300
|
|
- hi3516ev200
|
|
- hi3516ev300
|
|
- hi3518ev300
|
|
- hi3516dv200
|
|
- hi3536cv100
|
|
- hi3536dv100
|
|
- gk7205v200
|
|
- gk7205v210
|
|
- gk7205v300
|
|
- gk7202v300
|
|
- gk7605v100
|
|
- t31
|
|
release:
|
|
- lite
|
|
- ultimate
|
|
include:
|
|
- platform: hi3518ev200
|
|
release: mini
|
|
- platform: hi3516cv300
|
|
release: mini
|
|
- platform: hi3516ev200
|
|
release: fpv
|
|
- platform: hi3516ev300
|
|
release: fpv
|
|
- platform: gk7205v200
|
|
release: fpv
|
|
- platform: gk7205v300
|
|
release: fpv
|
|
|
|
# Original SDK test
|
|
- platform: gk7205v200
|
|
release: original
|
|
custom: onlyci
|
|
|
|
# MVP
|
|
- platform: fh8852v100
|
|
release: lite
|
|
- platform: fh8852v200
|
|
release: lite
|
|
- platform: gm8136
|
|
release: lite
|
|
- platform: nt98562
|
|
release: lite
|
|
- platform: nt98566
|
|
release: lite
|
|
- platform: ssc335
|
|
release: lite
|
|
- platform: ssc335de
|
|
release: lite
|
|
- platform: ssc337
|
|
release: lite
|
|
- platform: ssc337de
|
|
release: lite
|
|
- platform: t10
|
|
release: lite
|
|
- platform: t20
|
|
release: lite
|
|
- platform: t21
|
|
release: lite
|
|
- platform: xm510
|
|
release: lite
|
|
- platform: xm530
|
|
release: lite
|
|
- platform: xm550
|
|
release: lite
|
|
|
|
# TODO
|
|
- platform: ak3916ev300
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: ak3918ev300
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: gk7102
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: gk7102s
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: msc313e
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: msc316dc
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: msc316dm
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: rv1109
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: rv1126
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: s3l
|
|
release: lite
|
|
custom: onlyci
|
|
- platform: ssc325
|
|
release: lite
|
|
custom: onlyci
|
|
|
|
exclude:
|
|
- platform: hi3516cv100
|
|
release: ultimate
|
|
- platform: hi3518cv100
|
|
release: ultimate
|
|
- platform: hi3518ev100
|
|
release: ultimate
|
|
- platform: hi3516cv200
|
|
release: ultimate
|
|
- platform: hi3519v101
|
|
release: ultimate
|
|
- platform: hi3516ev100
|
|
release: ultimate
|
|
- platform: hi3516cv500
|
|
release: ultimate
|
|
- platform: hi3516dv300
|
|
release: ultimate
|
|
- platform: hi3516av300
|
|
release: ultimate
|
|
- platform: hi3516dv200
|
|
release: ultimate
|
|
- platform: hi3536cv100
|
|
release: ultimate
|
|
- platform: hi3536dv100
|
|
release: ultimate
|
|
- platform: gk7605v100
|
|
release: ultimate
|
|
- platform: gk7205v210
|
|
release: ultimate
|
|
- platform: gk7202v300
|
|
release: ultimate
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
|
|
|
- name: Checkout deps
|
|
if: ${{ env.FURRY != '' }}
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: furry-disco/deps
|
|
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
|
path: deps
|
|
submodules: recursive
|
|
ssh-key: ${{ secrets.FURRY }}
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo make install-deps
|
|
ls -l deps || true
|
|
if [ ! -z "$ACT" ]; then
|
|
echo "FORCE_UNSAFE_CONFIGURE=1" >> $GITHUB_ENV
|
|
else
|
|
# https://github.com/actions/runner-images/issues/2577
|
|
echo "1.1.1.1 invisible-mirror.net" | sudo tee -a /etc/hosts
|
|
fi
|
|
|
|
- name: Free disk space
|
|
if: ${{ !env.ACT }}
|
|
run: |
|
|
sudo apt clean
|
|
docker rmi $(docker image ls -aq)
|
|
|
|
- name: Prepare buildroot
|
|
run: |
|
|
HEAD_TAG=$(git tag --points-at HEAD)
|
|
GIT_HASH=$(git rev-parse --short $GITHUB_SHA)
|
|
BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)
|
|
if [ -z "$HEAD_TAG" ]; then
|
|
TAG_NAME="latest"
|
|
RELEASE_NAME="Development Build"
|
|
PRERELEASE=true
|
|
else
|
|
TAG_NAME=${{ github.ref }}
|
|
RELEASE_NAME="Release ${{ github.ref }}"
|
|
PRERELEASE=false
|
|
fi
|
|
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
|
|
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
|
|
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
|
|
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
|
|
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
|
|
|
- name: Determine toolchain name
|
|
run: |
|
|
BOARD=unknown_unknown_${{ matrix.platform }}_openipc
|
|
make BOARD=$BOARD prepare
|
|
TOOLNAME=$(make BOARD=$BOARD toolname)
|
|
echo "TOOLNAME=$TOOLNAME" >> $GITHUB_ENV
|
|
|
|
- uses: actions/download-artifact@v3
|
|
continue-on-error: true
|
|
with:
|
|
name: '${{ env.TOOLNAME }}.tgz'
|
|
|
|
- name: Build firmware
|
|
run: |
|
|
BOARD=unknown_unknown_${{ matrix.platform }}
|
|
if [ "${{ matrix.release }}" != "lite" ]; then
|
|
SUFF="${{ matrix.release }}-"
|
|
BOARD="${BOARD}_${{ matrix.release }}"
|
|
else
|
|
BOARD="${BOARD}_openipc"
|
|
fi
|
|
|
|
CONF_PATH=$(find . -name "${BOARD}_defconfig")
|
|
|
|
echo Using $TOOLNAME
|
|
if [ ! -f "$TOOLNAME.tgz" ]; then
|
|
wget -nv --retry-on-http-error=503 --continue --timeout=15 \
|
|
https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/${TOOLNAME}.tgz
|
|
fi
|
|
mkdir /tmp/extsdk
|
|
tar xvf ${TOOLNAME}.tgz --strip-components=1 -C /tmp/extsdk >/dev/null
|
|
set -x
|
|
|
|
TLEXT=BR2_TOOLCHAIN_EXTERNAL
|
|
echo "${TLEXT}=y" >> $CONF_PATH
|
|
echo "${TLEXT}_CUSTOM=y" >> $CONF_PATH
|
|
echo "${TLEXT}_PREINSTALLED=y" >> $CONF_PATH
|
|
echo "${TLEXT}_CXX=y" >> $CONF_PATH
|
|
echo "${TLEXT}_PATH=\"/tmp/extsdk\"" >> $CONF_PATH
|
|
|
|
SOC=$(echo $TOOLNAME | cut -d '-' -f 1)
|
|
ABI=""
|
|
case "$SOC" in
|
|
arm*|cortex*)
|
|
PREFIX=arm
|
|
ABI="eabi"
|
|
[[ $SOC =~ _hf$ ]] && ABI="${ABI}hf"
|
|
;;
|
|
mips_xburst)
|
|
PREFIX=mipsel
|
|
;;
|
|
esac
|
|
PREFIX="${PREFIX}-openipc-linux-"
|
|
|
|
LIBC=$(echo $TOOLNAME | cut -d '-' -f 3)
|
|
case "$LIBC" in
|
|
uclibc)
|
|
PREFIX="${PREFIX}${LIBC}gnu${ABI}"
|
|
UCCFG=/tmp/extsdk/${PREFIX}/sysroot/usr/include/bits/uClibc_config.h
|
|
check_uclibc_feature() { grep -q "\#define ${1} 1" ${UCCFG} && echo y || echo n; }
|
|
echo "${TLEXT}_LOCALE=$(check_uclibc_feature __UCLIBC_HAS_LOCALE__)" >> $CONF_PATH
|
|
echo "${TLEXT}_HAS_THREADS_DEBUG=$(check_uclibc_feature __PTHREADS_DEBUG_SUPPORT__)" >> $CONF_PATH
|
|
echo "${TLEXT}_HAS_SSP=y" >> $CONF_PATH
|
|
;;
|
|
musl)
|
|
PREFIX="${PREFIX}${LIBC}${ABI}"
|
|
;;
|
|
glibc)
|
|
PREFIX="${PREFIX}gnu${ABI}"
|
|
RPCH=/tmp/extsdk/${PREFIX}/sysroot/usr/include/rpc/rpc.h
|
|
check_glibc_rpc_feature() { test -f $RPCH && echo y || echo n ; }
|
|
echo "${TLEXT}_INET_RPC=$(check_glibc_rpc_feature)" >> $CONF_PATH
|
|
;;
|
|
esac
|
|
echo "${TLEXT}_CUSTOM_PREFIX=\"${PREFIX}\"" >> $CONF_PATH
|
|
CAP_LIBC=$(echo $LIBC | tr a-z A-Z)
|
|
echo "${TLEXT}_CUSTOM_${CAP_LIBC}=y" >> $CONF_PATH
|
|
LXHDRS=$(echo $TOOLNAME | cut -d '-' -f 4)
|
|
echo "${TLEXT}_HEADERS_${LXHDRS}=y" >> $CONF_PATH
|
|
GCC_VER=$(echo $TOOLNAME | cut -d '-' -f 2)
|
|
echo "${TLEXT}_GCC_${GCC_VER:3:1}=y" >> $CONF_PATH
|
|
echo "BR2_ROOTFS_POST_BUILD_SCRIPT=\"\$(TOPDIR)/../scripts/executing_commands_for_${LIBC}.sh\"" >> $CONF_PATH
|
|
cat $CONF_PATH
|
|
|
|
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
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
if [ -f uImage ]; then
|
|
# TODO: doesn't fit to lite
|
|
case ${{ matrix.platform }} in
|
|
hi3516cv500|hi3516dv300|hi3516av300)
|
|
MAX_KERNEL_SIZE=${MAX_KERNEL_SIZE_ULTIMATE}
|
|
MAX_ROOTFS_SIZE=${MAX_ROOTFS_SIZE_ULTIMATE}
|
|
;;
|
|
esac
|
|
|
|
case ${{ matrix.release }} in
|
|
lite)
|
|
check_exceeded uImage ${MAX_KERNEL_SIZE}
|
|
check_exceeded rootfs.squashfs ${MAX_ROOTFS_SIZE}
|
|
;;
|
|
ultimate|fpv)
|
|
check_exceeded uImage ${MAX_KERNEL_SIZE_ULTIMATE}
|
|
check_exceeded rootfs.squashfs ${MAX_ROOTFS_SIZE_ULTIMATE}
|
|
;;
|
|
esac
|
|
|
|
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
|
|
|
|
mv uImage uImage.${{ matrix.platform }}
|
|
mv rootfs.squashfs rootfs.squashfs.${{ matrix.platform }}
|
|
md5sum rootfs.squashfs.${{ matrix.platform }} > rootfs.squashfs.${{ matrix.platform }}.md5sum
|
|
md5sum uImage.${{ matrix.platform }} > uImage.${{ matrix.platform }}.md5sum
|
|
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
|
|
|
|
mv rootfs.ubi rootfs.ubi.${{ matrix.platform }}
|
|
mv rootfs.ubifs rootfs.ubifs.${{ matrix.platform }}
|
|
md5sum rootfs.ubifs.${{ matrix.platform }} > rootfs.ubifs.${{ matrix.platform }}.md5sum
|
|
case ${{ matrix.platform }} in
|
|
rv*)
|
|
mv zboot.img boot.img.${{ matrix.platform }}
|
|
md5sum boot.img.${{ matrix.platform }} > boot.img.${{ matrix.platform }}.md5sum
|
|
tar -cvzf $NANDFW_PATH boot.img* *rootfs.ubi*.${{ matrix.platform }}*
|
|
;;
|
|
*)
|
|
tar -cvzf $NANDFW_PATH uImage* *rootfs.ubi*.${{ matrix.platform }}*
|
|
;;
|
|
esac
|
|
fi
|
|
popd
|
|
|
|
- name: Send error message to telegram channel
|
|
env:
|
|
TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }}
|
|
TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }}
|
|
if: ${{ !env.ACT && failure() && github.event_name != 'pull_request' }}
|
|
run: |
|
|
TG_NOTIFY="${TG_NOTIFY:=Warning, Buildroot compiling error... ${{ matrix.platform }} (${{ matrix.release }})}"
|
|
TG_HEADER=$(echo -e "\r\n$TG_NOTIFY \r\n\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH \r\nTag: $TAG_NAME \r\n\r\n\xE2\x9A\xA0 GitHub Actions")
|
|
curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot$TG_TOKEN/sendMessage \
|
|
-F chat_id=$TG_CHANNEL -F text="$TG_HEADER"
|
|
exit 2
|
|
|
|
- name: Create release
|
|
if: ${{ !env.ACT && github.event_name != 'pull_request' && matrix.custom != 'onlyci' }}
|
|
uses: actions/create-release@v1
|
|
continue-on-error: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ env.TAG_NAME }}
|
|
release_name: ${{ env.RELEASE_NAME }}
|
|
draft: false
|
|
prerelease: ${{ env.PRERELEASE }}
|
|
|
|
- name: Upload NOR FW to release
|
|
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 }}
|
|
file: ${{ env.NORFW_PATH }}
|
|
asset_name: ${{ env.NORFW_FILE }}
|
|
tag: ${{ env.TAG_NAME }}
|
|
overwrite: true
|
|
|
|
- name: Upload NAND FW to release
|
|
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 }}
|
|
file: ${{ env.NANDFW_PATH }}
|
|
asset_name: ${{ env.NANDFW_FILE }}
|
|
tag: ${{ env.TAG_NAME }}
|
|
overwrite: true
|
|
|
|
- name: Send binary file to telegram channel
|
|
if: ${{ !env.ACT && github.event_name != 'pull_request' && matrix.custom != 'onlyci' }}
|
|
env:
|
|
TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }}
|
|
TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }}
|
|
run: |
|
|
TG_HEADER=$(echo -e "\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH \r\nTag: $TAG_NAME \r\n\r\n\xE2\x9C\x85 GitHub Actions")
|
|
curl $TG_OPTIONS -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot$TG_TOKEN/sendDocument \
|
|
-F chat_id=$TG_CHANNEL -F document="@$NORFW_PATH" -F caption="$TG_HEADER"
|
|
|
|
ci-build-check:
|
|
if: always() && github.event.pull_request
|
|
runs-on: ubuntu-latest
|
|
name: CI Build Check
|
|
needs: [buildroot]
|
|
steps:
|
|
- run: |
|
|
result="${{ needs.buildroot.result }}"
|
|
if [[ $result == "success" || $result == "skipped" ]]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|