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

添加树莓派1-5

parent 849504b9
name: build-RaspBerryPi-23.05.4-ImmortalWrt
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: "请选择路由器型号"
required: true
options:
- rpi
- rpi-2
- rpi-3
- rpi-4
- rpi-5
default: rpi-4
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 }}/raspberrypi/23.05.4/build.sh
- name: Build raspberrypi ImmortalWrt 24.10
run: |
profiles="${{ github.event.inputs.profile }}"
if [ "$profiles" = "rpi" ]; then
tag=bcm27xx-bcm2708-openwrt-23.05.4
echo "cpu=bcm2708" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-2" ]; then
tag=bcm27xx-bcm2709-openwrt-23.05.4
echo "cpu=bcm2709" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-3" ]; then
tag=bcm27xx-bcm2710-openwrt-23.05.4
echo "cpu=bcm2710" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-4" ]; then
tag=bcm27xx-bcm2711-openwrt-23.05.4
echo "cpu=bcm2711" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-5" ]; then
tag=bcm27xx-bcm2712-openwrt-23.05.4
echo "cpu=bcm2712" >> $GITHUB_ENV
fi
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 }}/raspberrypi/imm.config:/home/build/immortalwrt/.config" \
-v "${{ github.workspace }}/raspberrypi/23.05.4/build.sh:/home/build/openwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ROOTSIZE=$size \
immortalwrt/imagebuilder:$tag /bin/bash /home/build/openwrt/build.sh
done
ls ${{ github.workspace }}/bin/targets/bcm27xx/${{ env.cpu }}
- name: Generate Firmware SHA-256
run: |
cp ${{ github.workspace }}/bin/targets/bcm27xx/${{ env.cpu }}/*squashfs-factory.img.gz ${{ github.workspace }}
for file in *squashfs-factory.img.gz; do
sha256sum "$file" > "$file.sha256"
sha256sum -c "$file.sha256"
done
- name: Create info
run: |
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
extra_content="### 默认带docker"
echo -e "\n $extra_content" >> ${{ github.workspace }}/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-raspberrypi
name: immortalwrt-raspberrypi
body_path: ${{ github.workspace }}/info.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ImmortalWrt as release assets
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-raspberrypi
files: |
${{ github.workspace }}/*.img.gz
${{ github.workspace }}/*.sha256
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: build-RaspBerryPi-24.10-ImmortalWrt
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: "请选择路由器型号"
required: true
options:
- rpi
- rpi-2
- rpi-3
- rpi-4
- rpi-5
default: rpi-4
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 }}/raspberrypi/24.10/build.sh
- name: Build raspberrypi ImmortalWrt 24.10
run: |
profiles="${{ github.event.inputs.profile }}"
if [ "$profiles" = "rpi" ]; then
tag=bcm27xx-bcm2708-openwrt-24.10.0-rc3
echo "cpu=bcm2708" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-2" ]; then
tag=bcm27xx-bcm2709-openwrt-24.10.0-rc3
echo "cpu=bcm2709" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-3" ]; then
tag=bcm27xx-bcm2710-openwrt-24.10.0-rc3
echo "cpu=bcm2710" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-4" ]; then
tag=bcm27xx-bcm2711-openwrt-24.10.0-rc3
echo "cpu=bcm2711" >> $GITHUB_ENV
elif [ "$profiles" = "rpi-5" ]; then
tag=bcm27xx-bcm2712-openwrt-24.10.0-rc3
echo "cpu=bcm2712" >> $GITHUB_ENV
fi
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 }}/raspberrypi/imm.config:/home/build/immortalwrt/.config" \
-v "${{ github.workspace }}/raspberrypi/24.10/build.sh:/home/build/openwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ROOTSIZE=$size \
immortalwrt/imagebuilder:$tag /bin/bash /home/build/openwrt/build.sh
done
ls ${{ github.workspace }}/bin/targets/bcm27xx/${{ env.cpu }}
- name: Generate Firmware SHA-256
run: |
cp ${{ github.workspace }}/bin/targets/bcm27xx/${{ env.cpu }}/*squashfs-factory.img.gz ${{ github.workspace }}
for file in *squashfs-factory.img.gz; do
sha256sum "$file" > "$file.sha256"
sha256sum -c "$file.sha256"
done
- name: Create info
run: |
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
extra_content="### 默认带docker"
echo -e "\n $extra_content" >> ${{ github.workspace }}/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-raspberrypi
name: immortalwrt-raspberrypi
body_path: ${{ github.workspace }}/info.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ImmortalWrt as release assets
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-raspberrypi
files: |
${{ github.workspace }}/*.img.gz
${{ github.workspace }}/*.sha256
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#!/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..."
# 定义所需安装的包列表 23.05.4
PACKAGES=""
PACKAGES="$PACKAGES curl"
PACKAGES="$PACKAGES fdisk"
PACKAGES="$PACKAGES script-utils"
PACKAGES="$PACKAGES luci-i18n-diskman-zh-cn"
PACKAGES="$PACKAGES luci-i18n-opkg-zh-cn"
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-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 script-utils"
PACKAGES="$PACKAGES luci-i18n-firewall-zh-cn"
PACKAGES="$PACKAGES luci-i18n-filebrowser-zh-cn"
PACKAGES="$PACKAGES luci-i18n-samba4-zh-cn"
#24.10
PACKAGES="$PACKAGES luci-i18n-package-manager-zh-cn"
PACKAGES="$PACKAGES luci-i18n-ttyd-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."
This diff is collapsed.
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