Skip to content

build-x86-64-immortalwrt-23.05.4 #1

build-x86-64-immortalwrt-23.05.4

build-x86-64-immortalwrt-23.05.4 #1

name: build-x86-64-immortalwrt-23.05.4
on:
workflow_dispatch:
inputs:
profile:
description: '请输入要编译固件大小 单位(MB)'
required: true
default: '1024'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set executable permissions
run: chmod +x ${{ github.workspace }}/x86-64/build.sh
- name: Setup Docker and Build
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: Locate squashfs firmware files
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
uses: softprops/action-gh-release@master
with:
tag_name: DockerTarBuilder
name: ${{ env.RELEASE_NAME }}
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 Docker images as release assets
uses: softprops/[email protected]
with:
tag_name: Autobuild
files: ${{ github.workspace }}/*.img.gz
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}