-
Notifications
You must be signed in to change notification settings - Fork 57
executable file
·75 lines (67 loc) · 2.64 KB
/
dev_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build Dev Release
on:
push:
branches:
- dev
env:
DEV_RELEASE: /data/k510/dev-release
defaults:
run:
shell: bash
jobs:
build_image:
name: Build
runs-on: [self-hosted, k510_release]
timeout-minutes: 45
container:
image: ai.b-bug.org:5000/k510_sdk_github
env:
CONF: k510_${{ matrix.cfg }}_defconfig
ENV: dev-release
volumes:
- /data:/data
options: --hostname dev-release
strategy:
matrix:
cfg: ["crb_lp3_v1_2"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
clean: false
- name: Install toolchain
run: |
test -f toolchain/nds64le-linux-glibc-v5d.txz || wget -c https://ai.b-bug.org/k510/toolchain/nds64le-linux-glibc-v5d.txz -O toolchain/nds64le-linux-glibc-v5d.txz
test -f toolchain/nds64le-elf-mculib-v5d.txz || wget -c https://ai.b-bug.org/k510/toolchain/nds64le-elf-mculib-v5d.txz -O toolchain/nds64le-elf-mculib-v5d.txz
- name: Download cache package
run: |
test -f pkg-download/dl.tar.gz && rm pkg-download/dl.tar.gz
wget -qc https://ai.b-bug.org/k510/downloads/pkg-download/dl.tar.gz -O pkg-download/dl.tar.gz
echo "dl.tar.gz file md5 check"
md5sum pkg-download/dl.tar.gz
test -d dl_bak && rm -rf dl_bak
test -d dl && mv dl dl_bak
tar -xf pkg-download/dl.tar.gz
test -d dl/ai/ || mkdir -p dl/ai/
wget -qc https://ai.b-bug.org/k510/downloads/pkg-download/ai_kmodel_data.tar.xz -O dl/ai/ai_kmodel_data.tar.xz
echo "ai_kmodel_data.tar.xz file md5 check"
md5sum dl/ai/ai_kmodel_data.tar.xz
test -d dl/riscv-pk-k510 && (test -d dl/riscv-pk-k510 || mv dl_bak/riscv-pk-k510 dl/)
test -d dl_bak && rm -rf dl_bak
- name: Build image
run: |
sed -i "s/BR2_JLEVEL=5/BR2_JLEVEL=14/g" configs/$CONF
rm -rf $CONF
rm -rf buildroot-*
make CONF=$CONF
- name: Save image to dev release path
run: |
export HW=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"_"$3"_"$4}'`
echo $HW
VER=$(cat $CONF/target/etc/version/release_version | grep ".*CST-github-dev-release" | sed 's/\(.*\)CST-github-dev-release/\1/g') || exit 1
echo $VER
mkdir -p $DEV_RELEASE/$VER/$HW/
cp -r --sparse=always $CONF/images/* $DEV_RELEASE/$VER/$HW/
cp -r --sparse=always $CONF/target/etc/version/release_version $DEV_RELEASE/$VER/$HW/
test -d $DEV_RELEASE/latest && rm $DEV_RELEASE/latest
ln -s -f $DEV_RELEASE/$VER $DEV_RELEASE/latest