gnuton is testing out GitHub Actions 🚀 #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Containers | |
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 | |
on: [push] | |
jobs: | |
build-job: | |
name: build firmware | |
runs-on: ubuntu-latest | |
container: | |
image: gnuton/asuswrt-merlin-toolchains-docker:latest | |
env: | |
MERLINUPDATE: "y" | |
MODEL: "rt-ax82u" | |
SDK: "src-rt-5.02axhnd.675x" | |
GIT_REPO: "https://github.com/gnuton/asuswrt-merlin.ng.git" | |
PROJECT_DIR: "/project/asuswrt-merlin.ng" | |
UI: "none" | |
options: --user root | |
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 }}." | |
chown docker /project | |
chgrp docker /project | |
cd /project | |
su - docker | |
git clone --single-branch --branch master $GIT_REPO | |
ls /home/docker | |
- name: "Build" | |
run: | | |
echo "----- I am: $(id) -----" | |
su - docker | |
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 "----- 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 }}." |