-
Notifications
You must be signed in to change notification settings - Fork 6
83 lines (82 loc) · 2.86 KB
/
build_lpi4a.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
name: LicheePi-4A-Build-Fedora
on:
workflow_dispatch:
jobs:
prepare_release:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get time
id: time
uses: nanzm/[email protected]
with:
format: 'YYYYMMDD-HHmm'
- name: Create empty release
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.time.outputs.time }}
body_path: VERSION
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: main
draft: false
outputs:
release_id: ${{ steps.release.outputs.id }}
build:
runs-on: ubuntu-20.04
needs: prepare_release
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clean environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
set +e
docker rmi `docker images -q`
echo "Deleting files, please wait ..."
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
sudo -E apt-get -y purge \
azure-cli \
ghc* \
zulu* \
hhvm \
llvm* \
firefox \
google* \
dotnet* \
powershell \
openjdk* \
mysql* \
php*
sudo -E apt-get update
sudo -E apt-get -y install build-essential gcc-riscv64-linux-gnu asciidoc binutils bzip2 gawk gettext git libncurses5-dev msmtp libssl-dev texinfo libglib2.0-dev
sudo -E apt-get -y install patch python2.7 unzip zlib1g-dev lib32gcc-s1 libc6-dev-i386 subversion flex node-uglify git gcc-multilib p7zip p7zip-full xmlto libreadline-dev
sudo -E apt-get -y install python3 python3-pip python3-pyelftools haveged lrzsz scons ecj fastjar re2c xz-utils tar binutils ccache curl wget vim nano rsync coreutils
sudo -E apt-get -y install qemu-utils upx-ucl libelf-dev autoconf automake libtool autopoint antlr3 gperf wget curl swig gcc g++
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Build
shell: bash
run: |
sudo bash build_lpi4a.sh
- name: Upload
if: needs.prepare_release.outputs.release_id != ''
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.prepare_release.outputs.release_id }}
file: "./*.img.xz*;./firmware/*u-boot-*.bin"
draft: false
- name: Rollback release
if: failure() && needs.prepare_release.outputs.release_id != ''
uses: author/action-rollback@stable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.prepare_release.outputs.release_id }}