Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

Build Kernel

Build Kernel #63

Workflow file for this run

name: Build Kernel
# Ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
on:
workflow_call: {}
workflow_dispatch:
inputs:
version:
required: true
default: "23.05.3"
description: OpenWrt version
type: string
make_options:
required: true
default: "V=c"
description: |
make options. (default: "V=c")
[s]: stdout+stderr, [c]: commands, [w]: warnings/errors only
type: choice
options:
- "V=c"
- "V=w"
- "V=sc"
- "V=sw"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 180 # default 6 hour
env:
TZ: Asia/Tokyo
COMMIT_SHORT_SHA: null
BUILD_OPENWRT_VERSION: ${{ inputs.version || '23.05.3' }}
permissions:
actions: write
steps:
- name: Checkout from repository
uses: actions/[email protected]
- name: Set short git commit SHA
id: vars
run: |+
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Confirm git commit SHA output
run: echo ${{ env.COMMIT_SHORT_SHA }}
- name: Installing dependencies
run: |+
sudo apt update
sudo apt install build-essential --no-install-recommends --no-install-suggests --yes \
clang flex bison g++ gawk gcc-multilib g++-multilib gettext git \
libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget
- name: git clone openwrt/openwrt
run: |+
set -eux
git clone --verbose --progress --depth 1 --branch "v${{ env.BUILD_OPENWRT_VERSION }}" \
https://github.com/openwrt/openwrt.git
cd openwrt
- name: Cache before
run: |+
set -eux
pwd
ls -lah
ls -lah openwrt
du -m openwrt | sort -nr
- name: Cache dependencies
id: cache-build
uses: actions/[email protected]
with:
path: |
./openwrt
key: built-${{ env.BUILD_OPENWRT_VERSION }}-fortinet_fg-50e
- name: Cache after
run: |+
set -eux
pwd
ls -lah
ls -lah openwrt
du -m openwrt | sort -nr
- name: Cache hit check
run: |+
echo "-->${{ steps.cache-build.outputs.cache-hit }}<--"
- name: Update the feeds
working-directory: openwrt
run: |+
set -eux
sed -i'' -e '[email protected]/[email protected]/openwrt@g' ./feeds.conf.default
sed -i'' -e '[email protected]/[email protected]/openwrt@g' ./feeds.conf.default
./scripts/feeds update -a
./scripts/feeds install -a
- name: Expand to full config
working-directory: openwrt
run: |+
set -eux
cp ../config/mvebu-cortexa9-fortinet_fg-50e.ini .config
make defconfig
- name: Building firmware
working-directory: openwrt
run: |+
set -eux
cd .
time make --directory ./ -j $(($(nproc)+1)) ${{ inputs.make_options }} download
time make --directory ./ -j $(($(nproc)+1)) ${{ inputs.make_options }} world
echo ${{ env.BUILD_OPENWRT_VERSION }} > ./bin/targets/mvebu/cortexa9/version.tag
- name: Check files
run: |+
set -eux
ls -lahR ./openwrt/bin/packages
ls -lahR ./openwrt/bin/targets
- name: Upload to GitHub Actions Artifacts
uses: actions/upload-artifact@v4
with:
name: openwrt-imagebuilder-${{ env.BUILD_OPENWRT_VERSION }}-${{ env.COMMIT_SHORT_SHA }}
path: |
./openwrt/bin/packages
./openwrt/bin/targets