-
Notifications
You must be signed in to change notification settings - Fork 3
126 lines (118 loc) · 3.83 KB
/
avaotasbc-build_OP.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Build_avaota-op
on:
workflow_dispatch:
permissions:
contents: write
jobs:
prepare_release:
runs-on: ubuntu-22.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: README.md
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: openwrt-23.05
draft: false
outputs:
release_id: ${{ steps.release.outputs.id }}
build:
runs-on: ubuntu-22.04
needs: prepare_release
steps:
- name: Checkout
uses: actions/checkout@master
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
set +e
docker rmi `docker images -q`
[[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}"
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android 2>/dev/null
sudo -E apt-get -y update
sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true
sudo -E systemctl daemon-reload
echo "Deleting files, please wait ..."
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php \
/opt/*
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 ack binutils bison build-essential \
ccache cmake device-tree-compiler flex gawk gettext \
git gperf intltool libelf-dev libglib2.0-dev \
libgmp3-dev libltdl-dev libncurses5-dev libssl-dev \
libreadline-dev libtool wget nano patch sudo \
pkgconf python3 python3-pyelftools xxd zlib1g-dev \
subversion swig texinfo unzip rsync
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Clone source code
env:
REPO_URL: https://github.com/AvaotaSBC/openwrt.git
REPO_BRANCH: openwrt-23.05
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt
cd openwrt
- name: Update & Install feeds
working-directory: ./openwrt
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: Configuration Customization - Build_Openwrt
env:
CONFIG_FILE: 'default-conf/avaota-a1.config'
run: |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
cd openwrt && make defconfig
- name: Download package
working-directory: ./openwrt
run: |
make download -j$(nproc)
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Build firmware
working-directory: ./openwrt
run: |
echo -e "build."
make V=s -j$(nproc)
- 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: "./openwrt/bin/targets/avaotasbc/t527/*.gz*"
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 }}