Skip to content

build-x86-64-immortalwrt-23.05.4 #5

build-x86-64-immortalwrt-23.05.4

build-x86-64-immortalwrt-23.05.4 #5

name: build-x86-64-immortalwrt-23.05.4
on:
workflow_dispatch:
inputs:
profile:
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 }}/x86-64/build.sh
- name: Build ImmortalWrt-x86-64-eif
run: |
profiles="${{ github.event.inputs.profile }}"
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/build.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
immortalwrt/imagebuilder:x86-64-openwrt-23.05.4 /bin/bash /home/build/immortalwrt/build.sh
done
- name: Find squashfs firmware file
id: locate_files
run: |
# 查找符合条件的固件文件
firmware_files=$(find "${{ github.workspace }}/bin" -type f -name '*squashfs-combined*.img.gz')
# 格式化路径,以避免多余的换行或空格
firmware_files=$(echo "$firmware_files" | tr '\n' ' ')
echo "Squashfs firmware files located: $firmware_files"
echo "FIRMWARE_PATHS=$firmware_files" >> $GITHUB_ENV
# 提取文件名并设置为环境变量
firmware_name=$(basename "$firmware_files")
echo "FIRMWARE_NAME=$firmware_name" >> $GITHUB_ENV
- name: Create GitHub Release Info
uses: softprops/[email protected]
with:
tag_name: Autobuild
name: ImmortWrt-x86-64-efi
body: |
![GitHub Release](https://img.shields.io/github/v/release/wukongdaily/AutoBuild?style=for-the-badge&logoSize=amg&labelColor=%23FFBF00&color=%2300C598)
> Automatically generated release immortalWrt for x86-64
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ImmortWrt as release assets
uses: softprops/[email protected]
with:
tag_name: Autobuild
files: ${{ github.workspace }}/bin/targets/x86/64/immortalwrt-23.05.4-x86-64-generic-squashfs-combined-efi.img.gz
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}