Skip to content

Build_qualcommax-ipq60xx_jdyer1-docker #10

Build_qualcommax-ipq60xx_jdyer1-docker

Build_qualcommax-ipq60xx_jdyer1-docker #10

#=================================================
# Description: Build OpenWrt using GitHub Actions
# Lisence: MIT
# Author: eSirPlayground
# Youtube Channel: https://goo.gl/fvkdwm
#=================================================
name: Build_qualcommax-ipq60xx_jdyer1
# Add a button to trigger the workflow
on:
repository_dispatch:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: 释放空间
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
FEEDS_CONF: feeds_config/lean.feeds.conf.default
run: |
echo "FIRMWARE_VERSION=$(date +"%y%m%d-%H")" >> $GITHUB_ENV
echo "START_DATE=$(date +'%Y年%m月%d日 %H点%M分%S秒')" >> $GITHUB_ENV
set +e
docker rmi `docker images -q`
echo "Deleting files, please wait ..."
sudo rm -rf \
/usr/share/dotnet \
/usr/local/lib/android \
/opt/ghc \
/etc/mysql \
/etc/php
sudo -E apt-get -y purge azure-cli* docker* ghc* zulu* hhvm* llvm* firefox* google* dotnet* aspnetcore* powershell* openjdk* adoptopenjdk* mysql* php* mongodb* moby* snap* || true
sudo -E apt-get update
sudo -E apt-get -y install ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev qemu-img
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Clone source code
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
FEEDS_CONF: feeds_config/lean.feeds.conf.default
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt
[ -e $FEEDS_CONF ] && cp -r $FEEDS_CONF openwrt/feeds.conf.default
- name: Update & Install feeds
working-directory: ./openwrt
run: |
./scripts/feeds update -a
./scripts/feeds install -a
sed -i 's/192.168.1.1/192.168.16.1/g' package/base-files/files/bin/config_generate
sed -i 's/255.255.255.0/255.255.254.0/g' package/base-files/files/bin/config_generate
sed -i "s/hostname='OpenWrt'/hostname='Taiyi'/g" package/base-files/files/bin/config_generate
sed -i "s/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION='OpenWrt By AnnShine $(date +"%Y%m%d")'/g" package/base-files/files/etc/openwrt_release
cat package/base-files/files/bin/config_generate
#- name: Import external feeds - passwall
# working-directory: ./openwrt
# run: |
# git clone https://github.com/xiaorouji/openwrt-passwall.git package/lienol
# git clone "your_github_link" package/"your_folder_name"
#- name: Import external feeds - JerryKuKu Argon
# working-directory: ./openwrt
# run: |
# git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git package/luci-theme-argon-jerrykuku
- name: More App
run: |
cd openwrt
#find ./ | grep Makefile | grep v2ray-geodata | xargs rm -f
#find ./ | grep Makefile | grep mosdns | xargs rm -f
rm -rf ./feeds/luci/applications/luci-app-mosdns/
rm -rf ./feeds/packages/net/mosdns/
rm -rf ./package/custom_packages/mosdns
git clone https://github.com/sbwml/luci-app-mosdns -b v5 package/mosdns
#git clone https://github.com/sbwml/v2ray-geodata package/v2ray-geodata
rm -rf ./package/lean/luci-app-argon-config
git clone -b 18.06 https://github.com/jerrykuku/luci-app-argon-config.git ./package/lean/luci-app-argon-config
sed -i '/\/etc\/init\.d\/tailscale/d;/\/etc\/config\/tailscale/d;' feeds/packages/net/tailscale/Makefile
git clone https://github.com/asvow/luci-app-tailscale package/luci-app-tailscale
- name: Configuration Customization - Build_jdyer1
env:
CONFIG_FILE: 'jdyer1.config'
run: |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
# chmod +x ./customize.sh && ./customize.sh
cd openwrt && make defconfig
- name: Download package
working-directory: ./openwrt
run: |
make download -j1
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Build firmware
working-directory: ./openwrt
run: |
echo -e "$(nproc) thread compile"
make -j1 V=s
echo "status=success" >> $GITHUB_OUTPUT
- name : Upload artifact
uses: actions/upload-artifact@master
with:
name: OpenWrt-jdyer1
path: openwrt/bin/targets/*/*
- name: 整理固件
id: organize
run: |
# 整理固件包时候,删除您不想要的固件或者文件,让它不需要上传到Actions空间
cd openwrt/bin/targets/*/*
rm -rf packages
rm -rf version.buildinfo
rm -rf profiles.json
rm -rf *kernel*
rm -rf *.manifest
rm -rf sha256sums
mv *initramfs-uImage.itb ${{ env.FIRMWARE_VERSION }}-qualcommax-ipq60xx-jdcloud_re-cs-07-initramfs-uImage.itb
mv *squashfs-factory.bin ${{ env.FIRMWARE_VERSION }}-qualcommax-ipq60xx-jdcloud_re-cs-07-squashfs-factory.bin
mv *squashfs-recovery.bin ${{ env.FIRMWARE_VERSION }}-qualcommax-ipq60xx-jdcloud_re-cs-07-squashfs-recovery.bin
mv *squashfs-sysupgrade.bin ${{ env.FIRMWARE_VERSION }}-qualcommax-ipq60xx-jdcloud_re-cs-07-squashfs-sysupgrade.bin
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
echo "status=success" >> $GITHUB_OUTPUT
- name: 上传固件到Github Action空间
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && !cancelled()
with:
name: ${{ env.FIRMWARE_VERSION }}-OpenWrt-jdyer1-qualcommax-ipq60xx
path: ${{ env.FIRMWARE }}
- name: 创建release标签
id: tag
if: steps.organize.outputs.status == 'success' && !cancelled()
run: |
release_tag="${{ env.FIRMWARE_VERSION }}-OpenWrt-jdyer1-qualcommax-ipq60xx"
echo "编译时间:$(date +'%Y年%m月%d日 %H点%M分')" >> release.txt
echo "默认网关:192.168.16.1" >> release.txt
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT
- name: 将固件上传到release
uses: softprops/action-gh-release@v1
if: steps.tag.outputs.status == 'success' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ env.FIRMWARE_VERSION }}-OpenWrt-jdyer1-qualcommax-ipq60xx
tag_name: ${{ steps.tag.outputs.release_tag }}
body_path: release.txt
files: ${{ env.FIRMWARE }}/*
- name: 删除工作流运行
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 600
keep_minimum_runs: 30
- name: 删除旧的releases
uses: dev-drprasad/delete-older-releases@v0.1.0
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
with:
keep_latest: 30
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}