mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2025-12-31 11:03:36 +05:00
build: Add configure step
This commit is contained in:
47
.github/workflows/build.yml
vendored
47
.github/workflows/build.yml
vendored
@@ -11,8 +11,8 @@ on:
|
|||||||
options:
|
options:
|
||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
target_arch:
|
target_name:
|
||||||
description: 'Target ARCH'
|
description: 'Target Name'
|
||||||
required: false
|
required: false
|
||||||
default: 'r3d'
|
default: 'r3d'
|
||||||
type: string
|
type: string
|
||||||
@@ -32,6 +32,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }}
|
TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }}
|
||||||
|
TARGET_NAME: ${{ github.event.inputs.target_name }}
|
||||||
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
||||||
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
|
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
|
||||||
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
|
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
|
||||||
@@ -60,6 +61,9 @@ jobs:
|
|||||||
fw_date: ${{ steps.gh.outputs.fw_date }}
|
fw_date: ${{ steps.gh.outputs.fw_date }}
|
||||||
fw_ver: ${{ steps.gh.outputs.fw_ver }}
|
fw_ver: ${{ steps.gh.outputs.fw_ver }}
|
||||||
is_active: ${{ steps.activity.outputs.is_active }}
|
is_active: ${{ steps.activity.outputs.is_active }}
|
||||||
|
test_build: ${{ env.TEST_BUILD }}
|
||||||
|
target_name: ${{ env.TARGET_NAME }}
|
||||||
|
fake_build: ${{ env.FAKE_BUILD }}
|
||||||
steps:
|
steps:
|
||||||
- name: Get repo data via GH API
|
- name: Get repo data via GH API
|
||||||
id: gh
|
id: gh
|
||||||
@@ -144,7 +148,7 @@ jobs:
|
|||||||
exclude:
|
exclude:
|
||||||
- { isTest: true }
|
- { isTest: true }
|
||||||
include:
|
include:
|
||||||
- target: ${{ github.event.inputs.target_arch }}
|
- target: ${{ github.event.inputs.target_name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Initialization environment
|
- name: Initialization environment
|
||||||
env:
|
env:
|
||||||
@@ -188,17 +192,15 @@ jobs:
|
|||||||
cd $BUILD_ROOT && ./xupdate.sh -f
|
cd $BUILD_ROOT && ./xupdate.sh -f
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Build the firmware image
|
- name: Configure
|
||||||
id: compile
|
id: configure
|
||||||
if: steps.update.outputs.status == 'success'
|
if: steps.update.outputs.status == 'success'
|
||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
cd $BUILD_ROOT && echo "init build config"
|
||||||
MAKE_JOBS=$(($(nproc)+1))
|
FILE_DATE=$(date --utc +'%y%m%d')
|
||||||
echo "$MAKE_JOBS thread compile"
|
|
||||||
# init build config
|
|
||||||
./xmake.sh -I -t $TARGET
|
./xmake.sh -I -t $TARGET
|
||||||
G_DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' )
|
G_DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' )
|
||||||
[ -z "$G_DEVICE_NAME" ] && exit 31
|
[ -z "$G_DEVICE_NAME" ] && exit 31
|
||||||
@@ -213,16 +215,36 @@ jobs:
|
|||||||
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
||||||
exit 41
|
exit 41
|
||||||
fi
|
fi
|
||||||
# run build
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
echo "G_DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
||||||
|
echo "G_BOARD_NAME=$G_BOARD_NAME" >> $GITHUB_ENV
|
||||||
|
echo "G_SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
||||||
|
echo "FILE_DATE=$FILE_DATE" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Dump .config file
|
||||||
|
run: |
|
||||||
|
echo "====== .config ========="
|
||||||
|
cat $BUILD_ROOT/.config
|
||||||
|
echo "========================"
|
||||||
|
|
||||||
|
- name: Build the firmware image
|
||||||
|
id: compile
|
||||||
|
if: steps.configure.outputs.status == 'success'
|
||||||
|
env:
|
||||||
|
TARGET: ${{ matrix.target }}
|
||||||
|
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
||||||
|
run: |
|
||||||
|
cd $BUILD_ROOT
|
||||||
|
MAKE_JOBS=$(($(nproc)+1))
|
||||||
|
echo "$MAKE_JOBS thread compile"
|
||||||
if [ "$FAKE_BUILD" != "true" ]; then
|
if [ "$FAKE_BUILD" != "true" ]; then
|
||||||
if [ "$TEST_BUILD" != "true" ]; then
|
if [ "$TEST_BUILD" != "true" ]; then
|
||||||
make -j $MAKE_JOBS download world
|
make -j $MAKE_JOBS download world
|
||||||
else
|
else
|
||||||
make -j $MAKE_JOBS V=sc download world
|
make V=sc download world
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# process results
|
# process results
|
||||||
FILE_DATE=$(date --utc +'%y%m%d')
|
|
||||||
OUT_DIR=$BUILD_ROOT/bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
OUT_DIR=$BUILD_ROOT/bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
||||||
if [ "$FAKE_BUILD" = "true" ]; then
|
if [ "$FAKE_BUILD" = "true" ]; then
|
||||||
mkdir -p logs
|
mkdir -p logs
|
||||||
@@ -245,7 +267,6 @@ jobs:
|
|||||||
echo "SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
echo "SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
||||||
echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV
|
echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV
|
||||||
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
||||||
echo "FILE_DATE=$FILE_DATE" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Check space usage
|
- name: Check space usage
|
||||||
run: df -hT
|
run: df -hT
|
||||||
|
|||||||
Reference in New Issue
Block a user