-
Notifications
You must be signed in to change notification settings - Fork 10
64 lines (54 loc) · 2.04 KB
/
ci-release.yml
File metadata and controls
64 lines (54 loc) · 2.04 KB
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
name: Release Build
on:
push:
branches:
- 'release-*'
workflow_dispatch:
env:
DOCKER_IMAGE: imx-forge:ci
jobs:
build:
name: Build Release
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: 获取版本号
id: version
run: |
VERSION=${{ github.ref_name }}
echo "version=${VERSION#release-}" >> $GITHUB_OUTPUT
- name: 构建 Docker 镜像
run: cd docker && docker build -t ${{ env.DOCKER_IMAGE }} .
- name: 完整构建
run: |
docker run --rm --user root \
-v $PWD:/workspace \
-w /workspace \
${{ env.DOCKER_IMAGE }} \
bash -c "./scripts/release-all.sh"
- name: 验证构建产物
run: |
[ -f out/release-latest/uboot/u-boot-dtb.imx ] || exit 1
[ -f out/release-latest/linux/arch/arm/boot/zImage ] || exit 1
[ -f out/release-latest/rootfs/bin/busybox ] || exit 1
- name: 打包产物
run: |
cd out/release-latest/images
tar czf ../../imx-forge-${{ steps.version.outputs.version }}.tar.gz *
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: release-${{ steps.version.outputs.version }}
path: out/imx-forge-${{ steps.version.outputs.version }}.tar.gz
retention-days: 90
- name: 创建发布摘要
run: |
echo "## 🚀 IMX-Forge Release ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 构建产物" >> $GITHUB_STEP_SUMMARY
echo "- **U-Boot**: $(ls -lh out/release-latest/uboot/u-boot-dtb.imx | awk '{print $5}')" >> $GITHUB_STEP_SUMMARY
echo "- **Linux**: $(ls -lh out/release-latest/linux/arch/arm/boot/zImage | awk '{print $5}')" >> $GITHUB_STEP_SUMMARY
echo "- **RootFS**: $(du -sh out/release-latest/rootfs | awk '{print $1}')" >> $GITHUB_STEP_SUMMARY