-
Notifications
You must be signed in to change notification settings - Fork 89
120 lines (116 loc) · 4.61 KB
/
github-actions.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
name: Containers
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
build-job:
name: build firmware
runs-on: ubuntu-latest
strategy:
matrix:
include:
- model: "dsl-ax82u"
sdk: "src-rt-5.02axhnd.675x"
ui: "none"
- model: "rt-ax82u"
sdk: "src-rt-5.02axhnd.675x"
ui: "none"
- model: "rt-ax82u_v2"
sdk: "src-rt-5.04axhnd.675x"
ui: "none"
- model: "rt-ax92u"
sdk: "src-rt-5.02axhnd.675x"
ui: "none"
- model: "rt-ax5400"
sdk: "src-rt-5.04axhnd.675x"
ui: "none"
- model: "tuf-ax3000"
sdk: "src-rt-5.02axhnd.675x"
ui: "tuf"
- model: "tuf-ax5400"
sdk: "src-rt-5.02axhnd.675x"
ui: "tuf"
- build_tuf-ax5400
- build_tuf-ax3000
- build_tuf-ax5400_tuf
- build_tuf-ax3000_tuf
#- build_rt-ax95q
#- build_rt-axe95q
- build_rt-ax5400
container:
image: gnuton/asuswrt-merlin-toolchains-docker:latest
env:
MERLINUPDATE: "y"
MODEL: ${{ matrix.model }}
SDK: ${{ matrix.sdk }}
UI: ${{ matrix.ui }}
GIT_REPO: "https://github.com/gnuton/asuswrt-merlin.ng.git"
PROJECT_DIR: "/project/asuswrt-merlin.ng"
HOME: "/home/docker"
CHANGELOG_FILE: "/tmp/CHANGELOG"
options: --user docker
volumes:
- ${{ github.workspace }}:/project
steps:
- name: "Fetch code"
run: |
pwd
echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
sudo chmod 777 /project
cd /project
git clone --single-branch --depth 1 --branch master $GIT_REPO
ls /home/docker
- name: "Set version"
run: |
cd ${PROJECT_DIR}
export CIRCLE_TAG="${GITHUB_REF#refs/*/}"
if [ -z "${CIRCLE_TAG}" ]; then
echo "Nothing to do. Not a release."
else
TAG=$(echo ${CIRCLE_TAG} | sed 's/^[^.]*\.//')
MAJOR_VER=$(echo "${TAG}" | sed -E 's/([0-9.]*)[_-]?(.*)/\1/')
MINOR_VER=$(echo "${TAG}" | sed -E 's/([0-9.]*)[_-]?(.*)/\2/')
sed -i "s/SERIALNO=.*/SERIALNO=${MAJOR_VER}/g" release/src-rt/version.conf
sed -i "s/EXTENDNO=.*/EXTENDNO=${MINOR_VER}/g" release/src-rt/version.conf
fi
- name: Generate changelog
run: |
cd ${PROJECT_DIR}
python tools/get-last-notes.py > "${CHANGELOG_FILE}"
cat "${CHANGELOG_FILE}"
- name: "Build"
run: |
echo "----- I am: $(id) -----"
cd ${PROJECT_DIR}/release/${SDK}
echo "----- Files in dir: $(pwd) -----"
ls -alh
echo "----- Setting toolchains for ${SDK} -----"
if [[ ${SDK} == "src-rt-5.04axhnd.675x" ]]; then
source /home/docker/envs/bcm-hnd-ax-4.19.sh
elif [[ ${SDK} == "src-rt-5.02axhnd.675x" ]]; then
source /home/docker/envs/bcm-hnd.sh
elif [[ ${SDK} == "src-rt-5.02axhnd" ]]; then
source /home/docker/envs/bcm-hnd.sh
else
echo "SDK not supported"
exit -1
fi
echo "----- hack-ish fix ---------"
sudo ln -sf /home/docker/am-toolchains/brcm-arm-hnd /opt/toolchains
echo "----- Check envs dir ---------"
ls -alh /home/docker/envs/
echo "----- Debugging env vars -----"
env
echo "------ Setting UI as $UI ---------"
if [[ ${UI} == "tuf" ]]; then
echo "Enabling TUF UI"
sed -i 's/TUF_UI=n/TUF_UI=y/' ${PROJECT_DIR}/release/src-rt/target.mak
fi
echo "----- BUILD -----"
if [[ ${SKIP_BUILD} == "Y" ]]; then
echo "Skipping build"
exit 0
fi
make "$MODEL"
echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
echo "🍏 This job's status is ${{ job.status }}."