--- /dev/null
+name: Build OpenWrt snapshot
+
+on:
+ schedule:
+ - cron: "0 4 * * 0"
+ workflow_dispatch:
+
+jobs:
+ determine_targets:
+ name: Find available targets
+ runs-on: ubuntu-latest
+ outputs:
+ targets: ${{ steps.find_targets.outputs.targets }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Find targets
+ id: find_targets
+ run: |
+ TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null | awk '{ print $1 }')"
+ JSON='{"config": ["selinux"], "targets":['
+ FIRST=1
+ for TARGET in $TARGETS; do
+ [[ $FIRST -ne 1 ]] && JSON="$JSON"','
+ JSON="$JSON"'"'"${TARGET}"'"'
+ FIRST=0
+ done
+ JSON="$JSON"']}'
+
+ echo -e "\n---- targets ----\n"
+ echo "$JSON"
+ echo -e "\n---- targets ----\n"
+
+ echo "::set-output name=targets::$JSON"
+
+ build:
+ name: Build ${{ matrix.targets }}
+ needs: determine_targets
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: False
+ matrix: ${{fromJson(needs.determine_targets.outputs.targets)}}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ repository: "openwrt/openwrt"
+ fetch-depth: 0
+
+ - name: Cache sources
+ uses: davidsbond/cache@master
+ with:
+ path: dl/
+ key: Sources
+ update: True
+
+ - name: Initialization environment
+ env:
+ DEBIAN_FRONTEND: noninteractive
+ run: |
+ sudo apt-get -y install libncurses-dev qemu-utils
+ TARGET=$(echo ${{ matrix.targets }} | cut -d "/" -f 1)
+ SUBTARGET=$(echo ${{ matrix.targets }} | cut -d "/" -f 2)
+ echo "TARGET=$TARGET" >> "$GITHUB_ENV"
+ echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
+
+ - name: Update & Install feeds
+ run: |
+ ./scripts/feeds update -a
+ ./scripts/feeds install -a
+
+ - name: Set configuration
+ run: |
+ curl "https://downloads.openwrt.org/snapshots/targets/${{ matrix.targets }}/config.buildinfo" > .config
+ curl "https://raw.githubusercontent.com/aparcar/openwrt/staging/.ci/${{ matrix.config }}.config" >> .config
+
+ echo -e "\n---- config input ----\n"
+ cat .config
+ echo -e "\n---- config input ----\n"
+
+ make defconfig
+
+ echo -e "\n---- config post-defconfig ----\n"
+ cat .config
+ echo -e "\n---- config post-defconfig ----\n"
+
+ - name: Download package
+ run: |
+ make download -j$(nproc)
+
+ - name: Build tools
+ run: |
+ make tools/install -j$(nproc) || \
+ make tools/install V=s
+
+ - name: Build toolchain
+ run: |
+ make toolchain/install -j$(nproc) || \
+ make toolchain/install V=s
+
+ - name: Build target
+ run: |
+ make target/compile -j$(nproc) IGNORE_ERRORS='n m' || \
+ make target/compile IGNORE_ERRORS='n m' V=s
+
+ - name: Build packages
+ run: |
+ make package/compile -j$(nproc) IGNORE_ERRORS='n m' || \
+ make package/compile IGNORE_ERRORS='n m' V=s
+
+ make package/install -j$(nproc) || \
+ make package/install V=s
+
+ make package/index CONFIG_SIGNED_PACKAGES= V=s
+
+ - name: Add kmods feed
+ run: |
+ TOPDIR=$(pwd)
+ export TOPDIR
+ STAGE_ROOT="$(make --no-print-directory val.STAGING_DIR_ROOT)"
+ KERNEL_VERSION="$(make --no-print-directory -C target/linux \
+ val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | \
+ tr '\n' '-' | head -c -1)"
+
+ mkdir -p files/etc/opkg/
+ sed -e 's#^\(src/gz .*\)_core \(.*\)/packages$#&\n\1_kmods \2/kmods/'"${KERNEL_VERSION}#" \
+ "${STAGE_ROOT}/etc/opkg/distfeeds.conf" > files/etc/opkg/distfeeds.conf
+
+ echo -e "\n---- distfeeds.conf ----\n"
+ cat files/etc/opkg/distfeeds.conf
+ echo -e "\n---- distfeeds.conf ----\n"
+
+ - name: Build firmware
+ run: |
+ make target/install -j$(nproc) || \
+ make target/install V=s
+
+ - name: Buildinfo
+ run: |
+ make buildinfo V=s
+
+ - name: JSON overview
+ run: |
+ make json_overview_image_info V=s
+
+ - name: Checksum
+ run: |
+ make checksum V=s
+
+ - name: Upload kmods to S3
+ uses: jakejarvis/s3-sync-action@master
+ with:
+ args: --acl public-read --follow-symlinks --delete
+ env:
+ AWS_S3_BUCKET: openwrt-ci
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ AWS_S3_ENDPOINT: https://s3.asu.aparcar.org
+ SOURCE_DIR: bin/targets/${{ matrix.targets }}/
+ DEST_DIR: ${{ matrix.config }}/targtes/${{ matrix.targets }}/