Update LuCI-feed to yesterdays HEAD of master #2634
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: Build Firmware | |
on: | |
push: | |
branches: [ master, next, nightly/* ] | |
pull_request: | |
branches: [ master, next ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [ath79-generic, ath79-mikrotik, ath79-tiny, ramips-mt7620, mvebu-cortexa9] | |
fail-fast: false | |
env: | |
IS_BUILDBOT: yes | |
BUILD_LOG_DIR: logs | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install dependencies | |
run: sudo apt-get --quiet --assume-yes --no-install-recommends --no-show-upgraded install git build-essential libncurses5-dev zlib1g-dev gawk time unzip libxml-perl flex wget gawk gettext quilt python libssl-dev | |
- name: setup build-environment | |
run: | | |
mkdir logs | |
echo "MAKE_OPTS= -j$(nproc) TARGET=${{matrix.target}} IS_BUILDBOT=${IS_BUILDBOT} " >>$GITHUB_ENV | |
echo "next_buildstep=config" >>$GITHUB_ENV | |
df -h | |
echo "building branch (full): " ${GITHUB_REF} | |
echo "building branch (short):" ${GITHUB_REF##*/} | |
echo "building branch (prefix stripped):" ${GITHUB_REF#"refs/heads/"} | |
echo "building branch (replaced):" | |
echo ${GITHUB_REF} | sed -e 's#^[a-zA-Z]*/[a-zA-Z]*/##; s#/#_#g;' | |
# this sets env BRANCHNAME_normalized by removing the 1st two elements from $GITHUB_REF | |
# These elements are usually "refs/heads/" | |
# in addition replace all / by _ | |
var=$(echo ${GITHUB_REF} | sed -e 's#^[a-zA-Z]*/[a-zA-Z]*/##; s#/#_#g;') | |
echo helper-var: ${var} | |
echo "BRANCHNAME_normalized=${var}" >>$GITHUB_ENV | |
- name: change storage paths | |
run: | | |
echo "GITHUB_WORKSPACE is ${GITHUB_WORKSPACE}" | |
echo "setting download and bin folder to /mnt (as there are 9GB space and WORKSPACE is too small for ath79-generic)" | |
sudo mkdir -m 777 /mnt/build | |
mkdir "/mnt/build/bin" | |
mkdir "/mnt/build/downloads" | |
echo >>configs/common-autobuild.config 'CONFIG_BINARY_FOLDER="/mnt/build/bin"' | |
echo >>configs/common-autobuild.config 'CONFIG_DOWNLOAD_FOLDER="/mnt/build/downloads"' | |
cat configs/common-autobuild.config | |
# symlink the original folders to the new localtions, to satisfy "common" scripts | |
mkdir openwrt | |
ln -s /mnt/build/downloads openwrt/dl | |
ln -s /mnt/build/bin openwrt/bin | |
- name: OpenWrt ${{ env.next_buildstep }} | |
run: | | |
echo "debug ${{ env.BRANCHNAME_normalized }}" | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-config) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: OpenWrt-config to artifacts | |
run: cp openwrt/.config logs/openwrt.config | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: openwrt ${{ env.next_buildstep }} | |
if: ${{ env.next_buildstep != null }} | |
run: | | |
echo "running: make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep}" | |
make -f Makefile.autobuild ${MAKE_OPTS} ${next_buildstep} | |
nextstep=$(make -f Makefile.autobuild next-buildstep-for-${next_buildstep}) | |
echo "next_buildstep=${nextstep}" >>$GITHUB_ENV | |
- name: Archive build logs | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{matrix.target}}_logs | |
path: logs | |
- name: prepare upload of imagebuilder and sdk | |
run: | | |
mkdir -p tmp_build-tools | |
find openwrt/bin/ -name *imagebuilder*.tar.xz -exec mv '{}' tmp_build-tools/ \; | |
find openwrt/bin/ -name *sdk*.tar.xz -exec mv '{}' tmp_build-tools/ \; | |
- name: Archive imagebuilder and sdk | |
if: ${{ !cancelled() }} | |
continue-on-error: true | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.target }}_build-tools | |
path: tmp_build-tools | |
- name: Archive binaries | |
if: ${{ !cancelled() }} | |
continue-on-error: true | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.target }}_bins | |
path: openwrt/bin/ | |
- run: df -h | |
if: ${{ !cancelled() }} | |
- name: upload | |
if: github.event_name == 'push' | |
env: | |
SSH_KEY: ${{ secrets.OPENWRT_BUILDUPLOAD_PRIVATE }} | |
run: | | |
# create file-structure for target | |
mkdir "tmp_build-tools/${{ env.BRANCHNAME_normalized }}" | |
mv tmp_build-tools/*.tar.xz "tmp_build-tools/${{ env.BRANCHNAME_normalized }}/" | |
eval "$(ssh-agent -s)" | |
ssh-add - <<< "${SSH_KEY}" | |
scp -r -o StrictHostKeyChecking=no -P ${{ secrets.OPENWRT_BUILDUPLOAD_PORT }} tmp_build-tools/* [email protected]:../upload/ | |