forked from wukongdaily/AutoBuildImmortalWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (77 loc) · 2.91 KB
/
build-x86-64-24.10.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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'
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 }}"
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 \
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: Create GitHub Release Info
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: Autobuild-x86-64
name: ImmortWrt-x86-64-efi
body_path: ${{ github.workspace }}/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-x86-64
files: |
${{ github.workspace }}/*squashfs-combined-efi.img.gz
${{ github.workspace }}/*.sha256
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}