Skip to content

Commit

Permalink
Move project
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigFisher committed Apr 17, 2021
1 parent 74756a9 commit 3afbc7e
Show file tree
Hide file tree
Showing 9 changed files with 520 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/hi3516ev200_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: OpenIPC for Hi3516Ev200

on:
push:
branches:
- main
tags:
- "v*"

jobs:
build_core:
name: OpenIPC v2.0 for Hi3516Ev200
runs-on: ubuntu-18.04

steps:

- name: Checkout
id: checkout
uses: actions/checkout@v2

- name: Install build dependencies
id: install
run: |
make install-deps
mkdir -p tmp
- name: Free disk space
id: freshing
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- name: Prepare buildroot
id: prepare
run: |
HEAD_TAG=$(git tag --points-at HEAD)
GIT_HASH=$(git rev-parse --short $GITHUB_SHA)
BRANCH_NAME=$(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_NAME=$BRANCH_NAME" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE
make prepare
- name: Build Hi3516Ev200 firmware
id: build-hi3516ev200-firmware
continue-on-error: true
run: |
ARCHIVE_FW="${GITHUB_WORKSPACE}/output/images/openipc.hi3516ev200-br.tgz"
echo "ARCHIVE_FW=$ARCHIVE_FW" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE
make -j$(($(nproc)+1)) BOARD=unknown_unknown_hi3516ev200_openipc all
tar -C ${GITHUB_WORKSPACE}/output/images -cvzf $ARCHIVE_FW rootfs.squashfs uImage
- name: Build Hi3516Ev200 SDK
id: build-hi3516ev200-sdk
continue-on-error: true
run: |
ARCHIVE_SDK="${GITHUB_WORKSPACE}/output/images/arm-openipc-linux-musleabi_sdk-buildroot.tar.gz"
echo "ARCHIVE_SDK=$ARCHIVE_SDK" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE/output
make sdk
- name: Send warning message to telegram channel
env:
TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }}
TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }}
if: steps.build-hi3516ev200-firmware.outcome != 'success' || steps.build-hi3516ev200-sdk.outcome != 'success'
run: |
TG_OPTIONS="-s --connect-timeout 5 --max-time 15"
TG_NOTIFY="Warning, Buildroot compiling error..."
TG_HEADER=$(echo -e "\r\n$TG_NOTIFY \r\n\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \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"
- name: Create release
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 FW to release
uses: svenstaro/upload-release-action@v2
continue-on-error: true
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ARCHIVE_FW }}
asset_name: "openipc.hi3516ev200-br.tgz"
tag: ${{ env.TAG_NAME }}
overwrite: true

- name: Upload SDK to release
uses: svenstaro/upload-release-action@v2
continue-on-error: true
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ARCHIVE_SDK }}
asset_name: "arm-openipc-linux-musleabi_sdk-buildroot.tar.gz"
tag: ${{ env.TAG_NAME }}
overwrite: true

- name: Send binary file to telegram channel
env:
TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }}
TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }}
run: |
TG_OPTIONS="-s --connect-timeout 5 --max-time 15"
TG_HEADER=$(echo -e "\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \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="@$ARCHIVE_FW" -F caption="$TG_HEADER"
129 changes: 129 additions & 0 deletions .github/workflows/hi3516ev300_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: OpenIPC for Hi3516Ev300

on:
push:
branches:
- main
tags:
- "v*"

jobs:
build_core:
name: OpenIPC v2.0 for Hi3516Ev300
runs-on: ubuntu-18.04

steps:

- name: Checkout
id: checkout
uses: actions/checkout@v2

- name: Install build dependencies
id: install
run: |
make install-deps
mkdir -p tmp
- name: Free disk space
id: freshing
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- name: Prepare buildroot
id: prepare
run: |
HEAD_TAG=$(git tag --points-at HEAD)
GIT_HASH=$(git rev-parse --short $GITHUB_SHA)
BRANCH_NAME=$(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_NAME=$BRANCH_NAME" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE
make prepare
- name: Build Hi3516Ev300 firmware
id: build-hi3516ev300-firmware
continue-on-error: true
run: |
ARCHIVE_FW="${GITHUB_WORKSPACE}/output/images/openipc.hi3516ev300-br.tgz"
echo "ARCHIVE_FW=$ARCHIVE_FW" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE
make BOARD=unknown_unknown_hi3516ev300_openipc all
tar -C ${GITHUB_WORKSPACE}/output/images -cvzf $ARCHIVE_FW rootfs.squashfs uImage
- name: Build Hi3516Ev300 SDK
id: build-hi3516ev300-sdk
continue-on-error: true
run: |
ARCHIVE_SDK="${GITHUB_WORKSPACE}/output/images/arm-openipc-linux-musleabi_sdk-buildroot.tar.gz"
echo "ARCHIVE_SDK=$ARCHIVE_SDK" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE/output
make sdk
- name: Send warning message to telegram channel
env:
TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }}
TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }}
if: steps.build-hi3516ev300-firmware.outcome != 'success' || steps.build-hi3516ev300-sdk.outcome != 'success'
run: |
TG_OPTIONS="-s --connect-timeout 5 --max-time 15"
TG_NOTIFY="Warning, Buildroot compiling error..."
TG_HEADER=$(echo -e "\r\n$TG_NOTIFY \r\n\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \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"
- name: Create release
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 FW to release
uses: svenstaro/upload-release-action@v2
continue-on-error: true
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ARCHIVE_FW }}
asset_name: "openipc.hi3516ev300-br.tgz"
tag: ${{ env.TAG_NAME }}
overwrite: true

- name: Upload SDK to release
uses: svenstaro/upload-release-action@v2
continue-on-error: true
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ARCHIVE_SDK }}
asset_name: "arm-openipc-linux-musleabi_sdk-buildroot.tar.gz"
tag: ${{ env.TAG_NAME }}
overwrite: true

- name: Send binary file to telegram channel
env:
TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN_BOT_OPENIPC }}
TG_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL_OPENIPC_DEV }}
run: |
TG_OPTIONS="-s --connect-timeout 5 --max-time 15"
TG_HEADER=$(echo -e "\r\nCommit: $GIT_HASH \r\nBranch: $BRANCH_NAME \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="@$ARCHIVE_FW" -F caption="$TG_HEADER"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
buildroot-2021.02/
buildroot-2020.02/
buildroot-2019.11.1/
output/
Loading

0 comments on commit 3afbc7e

Please sign in to comment.