Build OpenWrt #1
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 OpenWrt | |
on: | |
workflow_dispatch: | |
inputs: | |
repository: | |
description: 'OpenWrt Repository' | |
required: true | |
type: string | |
default: 'openwrt/openwrt' | |
tag: | |
description: 'OpenWrt Version tag' | |
required: true | |
type: string | |
default: 'v23.05.2' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build OpenWrt | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout scripts repository | |
uses: actions/checkout@v4 | |
with: | |
path: source | |
ref: '' | |
- name: Checkout OpenWrt repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ inputs.repository }} | |
path: openwrt | |
ref: ${{ inputs.tag }} | |
- name: Install host tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential clang flex bison g++ gawk \ | |
gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev \ | |
python3-distutils rsync unzip zlib1g-dev file wget | |
- name: Apply patches | |
working-directory: openwrt | |
run: | | |
git apply $GITHUB_WORKSPACE/source/patches/*.patch | |
- name: Update && Install feeds | |
working-directory: openwrt | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
- name: Load config template | |
working-directory: openwrt | |
run: | | |
cat $GITHUB_WORKSPACE/source/templates/vikoomlink_kt6_defconfig > ./.config | |
- name: Show configuration | |
working-directory: openwrt | |
run: | | |
make defconfig | |
./scripts/diffconfig.sh | |
- name: Fetch kernel magic | |
working-directory: openwrt | |
run: ./vermagic_update.sh | |
- name: Download packages | |
working-directory: openwrt | |
run: make download -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh | |
- name: Build tools | |
working-directory: openwrt | |
run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh | |
- name: Build toolchain | |
working-directory: openwrt | |
run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh | |
- name: Build OpenWrt | |
working-directory: openwrt | |
run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh | |
- name: Upload logs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-fail-logs | |
path: "openwrt/logs" | |
- name: Upload image | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rt2960 | |
path: | | |
openwrt/bin/targets/**/**/* | |
!openwrt/bin/targets/**/**/packages |