8 Commits

Author SHA1 Message Date
remittor
ca4573f31f build: Fix reuse cache and rename env PACKAGE_DIR 2026-01-03 21:05:22 +03:00
remittor
f01482890b build: Add step "Set fixed workspace" 2026-01-02 18:59:05 +03:00
remittor
510a31e7ec build: Add step "Fix time stamps into restored dirs" 2026-01-02 16:44:12 +03:00
remittor
8f6a81ecd2 build: Add step "Configure 2" 2026-01-02 15:50:43 +03:00
remittor
68cb027109 build: Fix restore cache and disable step "Kernel compile" 2026-01-02 12:58:09 +03:00
remittor
acff39477b build: Fix save and restore cache for host tools 2026-01-01 22:28:00 +03:00
remittor
e57e548f61 xmake: Fix install fantastic packages keys and src 2026-01-01 21:12:16 +03:00
remittor
eb978ba58e build: Fix kernel step 2026-01-01 20:19:22 +03:00
2 changed files with 136 additions and 60 deletions

View File

@@ -4,21 +4,18 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
use_cache: use_cache:
description: 'Use cache for host tools' description: 'Restore cache for host tools'
required: true required: true
default: 'false' default: 'false'
type: choice type: choice
options: options:
- true - true
- false - false
first_kernel_compile: cache_ver:
description: 'First kernel compile' description: 'Use cache version'
required: true required: false
default: 'true' default: '0'
type: choice type: string
options:
- true
- false
test_build: test_build:
description: 'Test build (only spec target) ' description: 'Test build (only spec target) '
required: true required: true
@@ -52,17 +49,15 @@ on:
type: string type: string
env: env:
FIRST_KERNEL_COMPILE: ${{ github.event.inputs.first_kernel_compile == 'true' }}
TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }} TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }}
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' || '' }}
TARGET_NAME: ${{ github.event.inputs.target_name }} TARGET_NAME: ${{ github.event.inputs.target_name }}
PACKAGE_DIR: ${{ github.event.inputs.package_dir }} G_PKG_DIR: ${{ github.event.inputs.package_dir }}
REPO_URL: https://github.com/openwrt-xiaomi/openwrt REPO_URL: https://github.com/openwrt-xiaomi/openwrt
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-
DEPENDENCIES: ${{ github.workspace }}/dependencies-ubuntu.txt
TZ: UTC TZ: UTC
DEVICE_NAME: unknown DEVICE_NAME: unknown
BUILD_DATE: unknown BUILD_DATE: unknown
@@ -195,6 +190,16 @@ jobs:
remove-codeql: true remove-codeql: true
remove-docker-images: true remove-docker-images: true
- name: Set fixed workspace
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |
sudo mkdir -p $GITHUB_WORKSPACE/_temp
#sudo chown -R $USER:$USER $GITHUB_WORKSPACE
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "RUNNER_TEMP=$GITHUB_WORKSPACE/_temp" >> $GITHUB_ENV
- name: Checkout builder - name: Checkout builder
uses: actions/checkout@main uses: actions/checkout@main
@@ -208,39 +213,76 @@ jobs:
- name: Init builder - name: Init builder
run: | run: |
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/master/keys/apksign/20241123170031.pub
wget https://fantastic-packages.github.io/releases/25.12/20241123170031.pub
- name: Cache downloads (dl)
if: false
uses: actions/cache@v4
with:
path: dl
key: dl-${{ hashFiles('feeds.conf.default') }}
restore-keys: |
dl-
- name: Update OpenWrt packages - name: Update OpenWrt packages
id: update id: update
env:
USE_CACHE: ${{ github.event.inputs.use_cache }}
run: | run: |
./xupdate.sh -f ./xupdate.sh -f
mkdir -p logs mkdir -p logs
echo "status=success" >> $GITHUB_OUTPUT echo "status=success" >> $GITHUB_OUTPUT
echo "USE_CACHE=$USE_CACHE" >> $GITHUB_ENV
- name: Prepare for cache
id: cache_prepare
env:
TARGET: ${{ matrix.target }}
USE_CACHE: ${{ github.event.inputs.use_cache }}
CACHE_VER: ${{ github.event.inputs.cache_ver }}
run: |
if [ "$USE_CACHE" = "true" ]; then if [ "$USE_CACHE" = "true" ]; then
rm -rf staging_dir/ rm -rf staging_dir/
mkdir -p staging_dir/host mkdir -p staging_dir/host
rm -rf build_dir/
mkdir -p build_dir/host
fi fi
if [[ " kng_re r3g r3p " == *" $TARGET "* ]]; then
CACHE_ARCH=mips
else
CACHE_ARCH=arm
fi
echo "CACHE_ARCH = $CACHE_ARCH"
echo "USE_CACHE=$USE_CACHE" >> $GITHUB_ENV
echo "CACHE_VER=$CACHE_VER" >> $GITHUB_ENV
echo "CACHE_ARCH=$CACHE_ARCH" >> $GITHUB_ENV
echo "status=success" >> $GITHUB_OUTPUT
- name: Restore cache for host tools - name: Restore cache for host tools
id: tools_cache_restore id: tools_cache_restore
if: github.event.inputs.use_cache == 'true' if: github.event.inputs.use_cache == 'true'
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
with: with:
key: host-tools-${{ runner.os }}-${{ needs.check.outputs.fw_ver }}-${{ hashFiles('tools/**') }} key: host-tools-${{ env.CACHE_VER }}-${{ env.CACHE_ARCH }}-${{ hashFiles('tools/**') }}
path: | path: |
staging_dir/host staging_dir/host
build_dir/host
- name: Fix time stamps into restored dirs
if: github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit == 'true'
run: |
touch staging_dir/host/.prepared
touch staging_dir/host/.prereq-build
touch staging_dir/host/stamp/.* 2>/dev/null
find build_dir/host -name ".prepared*" -exec touch {} +
find build_dir/host -name ".configured" -exec touch {} +
find build_dir/host -name ".built" -exec touch {} +
- name: Inspect restored host tools
if: github.event.inputs.use_cache == 'true'
run: |
echo "====== openwrt-native.txt ======"
cat build_dir/host/pkgconf-*/openwrt-native.txt || true
echo "====== staging_dir/host ====="
du -sh staging_dir/host || true
ls -la staging_dir/host || true
echo "====== staging_dir/host/bin ====="
du -sh staging_dir/host/bin || true
ls -1 staging_dir/host/bin | head -20 || true
echo "====== build_dir/host ======="
du -sh build_dir/host || true
ls -1 build_dir/host | head -20 || true
echo "====== path info ========"
grep -R "/home/runner" build_dir/host | head
- name: Configure - name: Configure
id: configure id: configure
@@ -279,6 +321,8 @@ jobs:
echo "====== .config =========" echo "====== .config ========="
cat .config cat .config
echo "========================" echo "========================"
cp -f .config logs/config1
cp -f .config config1
- name: Monitor memory - name: Monitor memory
run: | run: |
@@ -298,6 +342,16 @@ jobs:
make -j$(nproc) download make -j$(nproc) download
echo "status=success" >> $GITHUB_OUTPUT echo "status=success" >> $GITHUB_OUTPUT
- name: Fix time stamps into restored dirs
if: github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit == 'true'
run: |
touch staging_dir/host/.prepared
touch staging_dir/host/.prereq-build
touch staging_dir/host/stamp/.* 2>/dev/null
find build_dir/host -name ".prepared*" -exec touch {} +
find build_dir/host -name ".configured" -exec touch {} +
find build_dir/host -name ".built" -exec touch {} +
- name: Build tools and toolchain - name: Build tools and toolchain
id: tools id: tools
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }} if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
@@ -305,31 +359,50 @@ jobs:
make toolchain/install -j$(nproc) make toolchain/install -j$(nproc)
echo "status=success" >> $GITHUB_OUTPUT echo "status=success" >> $GITHUB_OUTPUT
- name: Save cache for host tools (use_cache = true) - name: Save cache for host tools
id: tools_cache_save id: tools_cache_save
if: steps.tools.outputs.status == 'success' && github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit != 'true' if: steps.tools.outputs.status == 'success'
uses: actions/cache/save@v4 uses: actions/cache/save@v4
with: with:
key: ${{ steps.tools_cache_restore.outputs.cache-primary-key }} key: host-tools-${{ env.CACHE_VER }}-${{ env.CACHE_ARCH }}-${{ hashFiles('tools/**') }}
path: | path: |
staging_dir/host staging_dir/host
build_dir/host
- name: Save cache for host tools (use_cache = false) - name: Configure 2
id: tools_cache_save_2 id: configure2
if: steps.tools.outputs.status == 'success' && github.event.inputs.use_cache != 'true' if: steps.tools.outputs.status == 'success'
uses: actions/cache/save@v4 env:
with: TARGET: ${{ matrix.target }}
key: host-tools-${{ runner.os }}-${{ needs.check.outputs.fw_ver }}-${{ hashFiles('tools/**') }} run: |
path: | make clean
staging_dir/host ./xmake.sh -I -t $TARGET
mkdir -p logs
cp -f .config logs/config2
[ -f config1 ] && cp -f config1 logs/config1
- name: Kernel compile - name: Kernel compile
id: kernel id: kernel
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.first_kernel_compile == 'true' && github.event.inputs.fake_build != 'true' }} if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
run: | run: |
make target/linux/compile -j$(nproc) make target/linux/compile -j$(nproc)
echo "status=success" >> $GITHUB_OUTPUT echo "status=success" >> $GITHUB_OUTPUT
- name: <<< TEST compile >>>
if: false # ${{ steps.kernel.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
run: |
make buildinfo
echo "====== package/utils/lua/host/compile"
make package/utils/lua/host/compile
echo "====== package/system/apk/host/compile"
make package/system/apk/host/compile
cp -f .config logs/config3
echo "====== package/feeds/packages/mdio-netlink"
make package/feeds/packages/mdio-netlink/compile V=sc
# exit 78
# make package/feeds/packages/mdio-netlink/compile V=s --debug=j
# make package/feeds/packages/mdio-netlink/compile V=sc
- name: Monitor memory 2 - name: Monitor memory 2
run: | run: |
echo "Memory and swap:" echo "Memory and swap:"
@@ -347,8 +420,10 @@ jobs:
TARGET: ${{ matrix.target }} TARGET: ${{ matrix.target }}
run: | run: |
echo "Run $(nproc) thread compile" echo "Run $(nproc) thread compile"
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$PACKAGE_DIR" != "" ]; then if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$G_PKG_DIR" != "" ]; then
make $PACKAGE_DIR/compile V=sc BUILD_LOG=1 make target/linux/compile -j$(npoc)
echo "=============== BUILD PACKAGE: $G_PKG_DIR ==============="
make $G_PKG_DIR/compile V=sc BUILD_LOG=1
exit 99 exit 99
fi fi
if [ "$FAKE_BUILD" != "true" ]; then if [ "$FAKE_BUILD" != "true" ]; then
@@ -441,7 +516,7 @@ jobs:
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: logs-${{ matrix.target }}-${{ env.FW_DATE }} name: logs-${{ matrix.target }}-${{ needs.check.outputs.fw_date }}
path: logs-*.tar.xz path: logs-*.tar.xz
release: release:

View File

@@ -282,28 +282,29 @@ function build_target {
echo "Patch '$(basename $incfn)' result: OK" echo "Patch '$(basename $incfn)' result: OK"
done done
OPKG_DIR=$XDIR/files/etc/opkg APK_DIR=$XDIR/files/etc/apk
if [ -d $OPKG_DIR ]; then if [ -d $APK_DIR ]; then
rm -rf $OPKG_DIR rm -rf $APK_DIR
fi fi
FANT_PKG_KEY=$XDIR/53FF2B6672243D28.pub FANT_PKG_KEY=$XDIR/20241123170031.pub
if [ -f $FANT_PKG_KEY ]; then if [ -f $FANT_PKG_KEY ]; then
OPKG_SRC_DIR=$XDIR/package/system/opkg/files APK_SRC_DIR=$XDIR/package/system/apk/files
OPKG_KEYS_DIR=$OPKG_DIR/keys APK_KEYS_DIR=$APK_DIR/keys
mkdir -p $OPKG_KEYS_DIR mkdir -p $APK_KEYS_DIR
cp $FANT_PKG_KEY $OPKG_KEYS_DIR/53ff2b6672243d28 cp $FANT_PKG_KEY $APK_KEYS_DIR/fantastic-packages-20241123170031.pem
OPKG_CFEED_FN=$OPKG_DIR/customfeeds.conf APK_CFEED_FN=$APK_DIR/repositories.d/customfeeds.list
cp $OPKG_SRC_DIR/customfeeds.conf $OPKG_CFEED_FN mkdir -p $APK_DIR/repositories.d
PKG_LINK="https://fantastic-packages.github.io/packages/releases/<<VER>>/packages/<<ARCH>>" cp $APK_SRC_DIR/customfeeds.list $APK_CFEED_FN
echo "" >> $OPKG_CFEED_FN PKG_LINK="https://fantastic-packages.github.io/releases/<<VER>>/packages/<<ARCH>>"
echo "src/gz fantastic_packages_luci $PKG_LINK/luci" >> $OPKG_CFEED_FN echo "" >> $APK_CFEED_FN
echo "src/gz fantastic_packages_packages $PKG_LINK/packages" >> $OPKG_CFEED_FN echo "$PKG_LINK/luci/packages.adb" >> $APK_CFEED_FN
echo "src/gz fantastic_packages_special $PKG_LINK/special" >> $OPKG_CFEED_FN echo "$PKG_LINK/packages/packages.adb" >> $APK_CFEED_FN
echo "$PKG_LINK/special/packages.adb" >> $APK_CFEED_FN
TARGET_ARCH_PACKAGES=$( get_cfg_opt_value $CFG TARGET_ARCH_PACKAGES ) TARGET_ARCH_PACKAGES=$( get_cfg_opt_value $CFG TARGET_ARCH_PACKAGES )
[ -z "$TARGET_ARCH_PACKAGES" ] && die "Cannot find TARGET ARCH" [ -z "$TARGET_ARCH_PACKAGES" ] && die "Cannot find TARGET ARCH"
sed -i "s/<<VER>>/25.12/g" $OPKG_CFEED_FN sed -i "s/<<VER>>/25.12/g" $APK_CFEED_FN
sed -i "s/<<ARCH>>/$TARGET_ARCH_PACKAGES/g" $OPKG_CFEED_FN sed -i "s/<<ARCH>>/$TARGET_ARCH_PACKAGES/g" $APK_CFEED_FN
logmsg "Added support of Fantastic packages [https://fantastic-packages.github.io/packages]" logmsg "Added support of Fantastic packages [https://fantastic-packages.github.io/releases]"
fi fi
SYSCTLCONF_FN=$XDIR/files/etc/sysctl.conf SYSCTLCONF_FN=$XDIR/files/etc/sysctl.conf