mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-01-02 03:53:36 +05:00
build: Delete env.BUILD_ROOT
This commit is contained in:
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@@ -45,7 +45,6 @@ env:
|
|||||||
REPO_LNK: openwrt-xiaomi/openwrt
|
REPO_LNK: openwrt-xiaomi/openwrt
|
||||||
REPO_BRANCH: xq-25.12
|
REPO_BRANCH: xq-25.12
|
||||||
TAG_PREFIX: v25-
|
TAG_PREFIX: v25-
|
||||||
BUILD_ROOT: ${{ github.workspace }}/openwrt
|
|
||||||
DEPENDENCIES: ${{ github.workspace }}/dependencies-ubuntu.txt
|
DEPENDENCIES: ${{ github.workspace }}/dependencies-ubuntu.txt
|
||||||
TZ: UTC
|
TZ: UTC
|
||||||
DEVICE_NAME: unknown
|
DEVICE_NAME: unknown
|
||||||
@@ -183,22 +182,21 @@ jobs:
|
|||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
|
|
||||||
- name: Download OpenWrt sources
|
- name: Download OpenWrt sources
|
||||||
run: git clone --branch $REPO_BRANCH $REPO_URL.git $BUILD_ROOT
|
run: |
|
||||||
|
git clone --branch $REPO_BRANCH $REPO_URL.git openwrt
|
||||||
|
rm -rf .git
|
||||||
|
rsync -a openwrt/ ./
|
||||||
|
rm -rf openwrt
|
||||||
|
|
||||||
- name: Init builder
|
- name: Init builder
|
||||||
env:
|
|
||||||
BLDROOT: ${{ github.workspace }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
rsync -avq --exclude=".*" --exclude="$(basename $BUILD_ROOT)" $BLDROOT/ $BUILD_ROOT/
|
|
||||||
cd $BUILD_ROOT
|
|
||||||
chmod +x *.sh
|
chmod +x *.sh
|
||||||
wget https://github.com/fantastic-packages/packages/raw/refs/heads/25.12/keys/usign/53FF2B6672243D28.pub
|
wget https://github.com/fantastic-packages/packages/raw/refs/heads/25.12/keys/usign/53FF2B6672243D28.pub
|
||||||
|
|
||||||
- name: Update OpenWrt packages
|
- name: Update OpenWrt packages
|
||||||
id: update
|
id: update
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT && ./xupdate.sh -f
|
./xupdate.sh -f
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
@@ -208,8 +206,6 @@ jobs:
|
|||||||
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 && echo "init build config"
|
|
||||||
FILE_DATE=$(date --utc +'%y%m%d')
|
|
||||||
./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
|
||||||
@@ -224,6 +220,7 @@ 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
|
||||||
|
FILE_DATE=$(date --utc +'%y%m%d')
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
echo "FW_VER=$FW_VER" >> $GITHUB_ENV
|
echo "FW_VER=$FW_VER" >> $GITHUB_ENV
|
||||||
echo "G_DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
echo "G_DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
||||||
@@ -234,14 +231,13 @@ jobs:
|
|||||||
- name: Dump .config file
|
- name: Dump .config file
|
||||||
run: |
|
run: |
|
||||||
echo "====== .config ========="
|
echo "====== .config ========="
|
||||||
cat $BUILD_ROOT/.config
|
cat .config
|
||||||
echo "========================"
|
echo "========================"
|
||||||
|
|
||||||
- name: Download tools and toolchain
|
- name: Download tools and toolchain
|
||||||
id: tools_download
|
id: tools_download
|
||||||
if: false # steps.configure.outputs.status == 'success'
|
if: false # steps.configure.outputs.status == 'success'
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
|
||||||
G_TARGET_ARCH=$( grep -so '^CONFIG_TARGET_ARCH_PACKAGES=' .config | cut -d'"' -f2 )
|
G_TARGET_ARCH=$( grep -so '^CONFIG_TARGET_ARCH_PACKAGES=' .config | cut -d'"' -f2 )
|
||||||
echo "G_TARGET_ARCH=$G_TARGET_ARCH" >> $GITHUB_ENV
|
echo "G_TARGET_ARCH=$G_TARGET_ARCH" >> $GITHUB_ENV
|
||||||
echo "OpenWrt version: $FW_VER"
|
echo "OpenWrt version: $FW_VER"
|
||||||
@@ -314,12 +310,8 @@ jobs:
|
|||||||
id: tools
|
id: tools
|
||||||
if: steps.configure.outputs.status == 'success'
|
if: steps.configure.outputs.status == 'success'
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
|
||||||
MAKE_JOBS=$(nproc)
|
|
||||||
echo "$MAKE_JOBS thread compile"
|
|
||||||
export CCACHE=1
|
export CCACHE=1
|
||||||
make tools/install -j$MAKE_JOBS
|
make toolchain/install -j$(nproc)
|
||||||
make toolchain/install -j$MAKE_JOBS
|
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Build the firmware image
|
- name: Build the firmware image
|
||||||
@@ -328,9 +320,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
echo "Run $(nproc) thread compile"
|
||||||
MAKE_JOBS=$(nproc)
|
|
||||||
echo "$MAKE_JOBS thread compile"
|
|
||||||
export CCACHE=1
|
export CCACHE=1
|
||||||
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$PACKAGE_DIR" != "" ]; then
|
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$PACKAGE_DIR" != "" ]; then
|
||||||
make $PACKAGE_DIR/compile V=sc BUILD_LOG=1
|
make $PACKAGE_DIR/compile V=sc BUILD_LOG=1
|
||||||
@@ -338,13 +328,13 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
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$(nproc) download world
|
||||||
else
|
else
|
||||||
make V=sc download world
|
make V=sc download world
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# process results
|
# process results
|
||||||
OUT_DIR=$BUILD_ROOT/bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
OUT_DIR=bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
||||||
if [ "$FAKE_BUILD" = "true" ]; then
|
if [ "$FAKE_BUILD" = "true" ]; then
|
||||||
mkdir -p logs
|
mkdir -p logs
|
||||||
mkdir -p $OUT_DIR
|
mkdir -p $OUT_DIR
|
||||||
@@ -375,9 +365,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
FW_DATE: ${{ needs.check.outputs.fw_date }}
|
FW_DATE: ${{ needs.check.outputs.fw_date }}
|
||||||
LOGS_DIR: ${{ env.BUILD_ROOT }}/logs
|
|
||||||
run: |
|
run: |
|
||||||
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz $LOGS_DIR
|
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz logs
|
||||||
|
|
||||||
- name: Cleanup OUT directory
|
- name: Cleanup OUT directory
|
||||||
if: steps.compile.outputs.status == 'success'
|
if: steps.compile.outputs.status == 'success'
|
||||||
|
|||||||
Reference in New Issue
Block a user