Unverified Commit e03a893b authored by wukongdaily's avatar wukongdaily Committed by GitHub
Browse files

新增全志平台R1S、香橙派Zero3等机型的工作流

parent d08c739b
name: build-sunxi-cortexa53-23.05.4-ImmpotalWrt
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: "请选择路由器型号"
required: true
options:
- friendlyarm_nanopi-r1s-h5
- xunlong_orangepi-zero-plus
- friendlyarm_nanopi-neo2
- xunlong_orangepi-pc2
- friendlyarm_nanopi-neo-plus2
- libretech_all-h3-cc-h5
- pine64_pine64-plus
- pine64_sopine-baseboard
default: friendlyarm_nanopi-r1s-h5
include_docker:
description: |
是否编译 Docker 插件
required: true
default: 'no'
type: choice
options:
- 'yes'
- 'no'
size:
description: '请输入要编译固件大小 单位(MB)'
required: true
default: '1024'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set executable permissions
run: |
chmod +x ${{ github.workspace }}/sunxi-cortexa53/build.sh
- name: Build Gl-iNet ImmpotalWrt 23.05.4
run: |
profiles="${{ github.event.inputs.profile }}"
include_docker="${{ github.event.inputs.include_docker }}"
size="${{ github.event.inputs.size }}"
IFS=',' read -r -a profile_array <<< "$profiles"
for profile in "${profile_array[@]}"; do
echo "Building for profile: $profile"
docker run --rm -i \
--user root \
-v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \
-v "${{ github.workspace }}/files:/home/build/immortalwrt/files" \
-v "${{ github.workspace }}/sunxi-cortexa53/build.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ROOTSIZE=$size \
immortalwrt/imagebuilder:sunxi-cortexa53-openwrt-23.05.4 /bin/bash /home/build/immortalwrt/build.sh
done
- name: Create info
run: |
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
extra_content="### 默认带docker"
echo -e "\n $extra_content" >> ${{ github.workspace }}/sunxi-cortexa53/info.md
else
echo -e "NO docker"
fi
- name: Create GitHub Release Info
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-sunxi-cortexa53
name: ImmortalWrt-sunxi-cortexa53
body_path: ${{ github.workspace }}/sunxi-cortexa53/info.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ImmortWrt as release assets
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-sunxi-cortexa53
files: ${{ github.workspace }}/bin/targets/sunxi/cortexa53/*squashfs-sdcard.img.gz
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
name: build-sunxi-cortexa53-24.10-ImmpotalWrt
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: "请选择路由器型号"
required: true
options:
- xunlong_orangepi-zero3
- friendlyarm_nanopi-r1s-h5
- xunlong_orangepi-zero2
- xunlong_orangepi-zero-plus
- friendlyarm_nanopi-neo2
- xunlong_orangepi-pc2
- friendlyarm_nanopi-neo-plus2
- libretech_all-h3-cc-h5
- pine64_pine64-plus
- pine64_sopine-baseboard
default: xunlong_orangepi-zero3
include_docker:
description: |
是否编译 Docker 插件
required: true
default: 'no'
type: choice
options:
- 'yes'
- 'no'
size:
description: '请输入要编译固件大小 单位(MB)'
required: true
default: '1024'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set executable permissions
run: |
chmod +x ${{ github.workspace }}/sunxi-cortexa53/build.sh
- name: Build Gl-iNet ImmpotalWrt 24.10
run: |
profiles="${{ github.event.inputs.profile }}"
include_docker="${{ github.event.inputs.include_docker }}"
size="${{ github.event.inputs.size }}"
IFS=',' read -r -a profile_array <<< "$profiles"
for profile in "${profile_array[@]}"; do
echo "Building for profile: $profile"
docker run --rm -i \
--user root \
-v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \
-v "${{ github.workspace }}/files:/home/build/immortalwrt/files" \
-v "${{ github.workspace }}/sunxi-cortexa53/24.10/build.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ROOTSIZE=$size \
immortalwrt/imagebuilder:sunxi-cortexa53-openwrt-24.10 /bin/bash /home/build/immortalwrt/build.sh
done
- name: Create info
run: |
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
extra_content="### 默认带docker"
echo -e "\n $extra_content" >> ${{ github.workspace }}/sunxi-cortexa53/info.md
else
echo -e "NO docker"
fi
- name: Create GitHub Release Info
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-sunxi-cortexa53
name: ImmortalWrt-sunxi-cortexa53
body_path: ${{ github.workspace }}/sunxi-cortexa53/info.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ImmortWrt as release assets
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-sunxi-cortexa53
files: ${{ github.workspace }}/bin/targets/sunxi/cortexa53/*squashfs-sdcard.img.gz
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
#!/bin/bash
# yml 传入的路由器型号 PROFILE
echo "Building for profile: $PROFILE"
echo "Include Docker: $INCLUDE_DOCKER"
# yml 传入的固件大小 ROOTFS_PARTSIZE
echo "Building for ROOTFS_PARTSIZE: $ROOTSIZE"
# 输出调试信息
echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting build process..."
# 定义所需安装的包列表
PACKAGES=""
PACKAGES="$PACKAGES curl"
PACKAGES="$PACKAGES fdisk"
PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn"
PACKAGES="$PACKAGES luci-i18n-filebrowser-zh-cn"
PACKAGES="$PACKAGES luci-app-argon-config"
PACKAGES="$PACKAGES luci-i18n-argon-config-zh-cn"
PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn"
#24.10
PACKAGES="$PACKAGES luci-i18n-package-manager-zh-cn"
PACKAGES="$PACKAGES luci-i18n-ttyd-zh-cn"
PACKAGES="$PACKAGES luci-i18n-passwall-zh-cn"
PACKAGES="$PACKAGES luci-app-openclash"
PACKAGES="$PACKAGES luci-i18n-homeproxy-zh-cn"
PACKAGES="$PACKAGES openssh-sftp-server"
# 判断是否需要编译 Docker 插件
if [ "$INCLUDE_DOCKER" = "yes" ]; then
PACKAGES="$PACKAGES luci-i18n-dockerman-zh-cn"
echo "Adding package: luci-i18n-dockerman-zh-cn"
fi
# 构建镜像
echo "$(date '+%Y-%m-%d %H:%M:%S') - Building image with the following packages:"
echo "$PACKAGES"
make image PROFILE=$PROFILE PACKAGES="$PACKAGES" FILES="/home/build/immortalwrt/files" ROOTFS_PARTSIZE=$ROOTSIZE
if [ $? -ne 0 ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - Error: Build failed!"
exit 1
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - Build completed successfully."
#!/bin/bash
# yml 传入的路由器型号 PROFILE
echo "Building for profile: $PROFILE"
echo "Include Docker: $INCLUDE_DOCKER"
# yml 传入的固件大小 ROOTFS_PARTSIZE
echo "Building for ROOTFS_PARTSIZE: $ROOTSIZE"
# 输出调试信息
echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting build process..."
# 定义所需安装的包列表
PACKAGES=""
PACKAGES="$PACKAGES curl"
PACKAGES="$PACKAGES fdisk"
PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn"
PACKAGES="$PACKAGES luci-i18n-filebrowser-zh-cn"
PACKAGES="$PACKAGES luci-app-argon-config"
PACKAGES="$PACKAGES luci-i18n-argon-config-zh-cn"
PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn"
#23.05
PACKAGES="$PACKAGES luci-i18n-opkg-zh-cn"
PACKAGES="$PACKAGES luci-i18n-ttyd-zh-cn"
PACKAGES="$PACKAGES luci-i18n-passwall-zh-cn"
PACKAGES="$PACKAGES luci-app-openclash"
PACKAGES="$PACKAGES luci-i18n-homeproxy-zh-cn"
PACKAGES="$PACKAGES openssh-sftp-server"
# 判断是否需要编译 Docker 插件
if [ "$INCLUDE_DOCKER" = "yes" ]; then
PACKAGES="$PACKAGES luci-i18n-dockerman-zh-cn"
echo "Adding package: luci-i18n-dockerman-zh-cn"
fi
# 构建镜像
echo "$(date '+%Y-%m-%d %H:%M:%S') - Building image with the following packages:"
echo "$PACKAGES"
make image PROFILE=$PROFILE PACKAGES="$PACKAGES" FILES="/home/build/immortalwrt/files" ROOTFS_PARTSIZE=$ROOTSIZE
if [ $? -ne 0 ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - Error: Build failed!"
exit 1
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - Build completed successfully."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment