-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (84 loc) · 2.99 KB
/
build_manual.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CanMV K230 Build for PreRelease
on:
workflow_dispatch:
inputs:
configs:
description: 'The config list which will compiled'
required: false
type: string
default: "k230_canmv_01studio_defconfig k230_canmv_defconfig k230_canmv_dongshanpi__512_defconfig k230_canmv_lckfb_defconfig k230_canmv_v3p0_defconfig k230d_canmv_bpi_zero_defconfig"
jobs:
build:
runs-on: ubuntu-20.04
permissions:
contents: write
defaults:
run:
shell: bash
steps:
- name: Setup SSH
run: |
# configure git
git config --global user.name kendryte747
git config --global user.email kendryte747@gmail.com
# update ssh key
mkdir -p ~/.ssh
echo "${{ secrets.ACTIONS_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Install repo
run: |
# install repo
mkdir -p ~/.bin/
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod +x ~/.bin/repo
- name: Prepare code
run: |
rm -rf *
ls -alh
~/.bin/repo init -u git@github.com:canmv-k230/manifest.git
~/.bin/repo sync
- name: Prepare Environment
run: |
sudo apt update
sudo apt install -y bison flex gcc libncurses5-dev pkg-config \
libconfuse-dev libssl-dev python3 python3-pip python-is-python3 \
cmake libyaml-dev scons mtools bzip2
pip3 install pycryptodome gmssl
- name: Download toolchains
run: |
make dl_toolchain
- name: Build Projects
run: |
projects=($CONFIGS)
echo "Config list is ${projects}"
for proj in ${projects[@]};do
echo "-------------------"
echo "build project ${proj}"
echo "-------------------"
make ${proj}
time make log
echo "-------------------"
done
env:
CONFIGS: ${{ inputs.configs }}
- name: Set Env
run: |
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
- name: Set Relese Txt
run: |
cat > prerelease.txt << 'EOF'
Pre Release自动编译,并会删除旧的编译产物,只保留当前最新镜像,仅供测试使用
Pre Release build with latest ${{ github.ref_name }} branch, it will delete old build and only keeping the latest version.
Current ${{ github.ref_name }} branch build at ${{ env.BUILDTIME }} , Current build git commit id ${{ github.sha }}
EOF
- name: Upload images to PreRelease Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/main')
with:
tag_name: PreRelease-${{ github.ref_name }}
files: |
output/**/*.img.gz
output/**/*.img.sha256
prerelease: true
generate_release_notes: true
body_path: prerelease.txt