build-x86-64-immortalwrt-24.10 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-x86-64-immortalwrt-24.10 | |
on: | |
workflow_dispatch: | |
inputs: | |
profile: | |
description: '请输入要编译固件大小 单位(MB)' | |
required: true | |
default: '1024' | |
include_docker: | |
description: | | |
是否编译 Docker 插件 | |
required: true | |
default: 'yes' | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
enable_pppoe: | |
description: "是否配置PPPoE拨号信息?" | |
required: true | |
default: 'no' | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
pppoe_account: | |
description: "宽带账号 (若启用PPPoE)" | |
required: false | |
pppoe_password: | |
description: "宽带密码 (若启用PPPoE)" | |
required: false | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set executable permissions | |
run: chmod +x ${{ github.workspace }}/x86-64/build.sh | |
- name: Validate PPPoE Inputs | |
run: | | |
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then | |
if [[ -z "${{ inputs.pppoe_account }}" || -z "${{ inputs.pppoe_password }}" ]]; then | |
echo "Error: PPPoE account and password must be provided when PPPoE is enabled!" | |
exit 1 | |
fi | |
fi | |
- name: Build ImmortalWrt-x86-64-eif | |
run: | | |
profiles="${{ github.event.inputs.profile }}" | |
include_docker="${{ github.event.inputs.include_docker }}" | |
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 }}/x86-64/imm.config:/home/build/immortalwrt/.config" \ | |
-v "${{ github.workspace }}/x86-64/24.10/build.sh:/home/build/immortalwrt/build.sh" \ | |
-e PROFILE=$profile \ | |
-e INCLUDE_DOCKER=$include_docker \ | |
-e ENABLE_PPPOE=${{ inputs.enable_pppoe }} \ | |
-e PPPOE_ACCOUNT=${{ inputs.pppoe_account }} \ | |
-e PPPOE_PASSWORD=${{ inputs.pppoe_password }} \ | |
immortalwrt/imagebuilder:x86-64-openwrt-24.10.0-rc3 /bin/bash /home/build/immortalwrt/build.sh | |
done | |
- name: Generate Firmware SHA-256 | |
run: | | |
cp ${{ github.workspace }}/bin/targets/x86/64/*squashfs-combined-efi.img.gz ${{ github.workspace }} | |
for file in *squashfs-combined-efi.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: Upload ImmortWrt as release assets | |
uses: softprops/[email protected] | |
with: | |
tag_name: Autobuild-x86-64 | |
body_path: ${{ github.workspace }}/info.md | |
files: | | |
${{ github.workspace }}/*squashfs-combined-efi.img.gz | |
${{ github.workspace }}/*.sha256 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |