mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-14 18:20:30 +08:00
- 添加自动下载缺失文件功能,支持 .xz 压缩格式 - 优化构建流程,增加文件清理和压缩功能 - 修复发布资产上传步骤,确保预发布标记正确设置 - 调整发布标签格式,包含版本号、设备目标和运行 ID - 升级 Actions 版本,使用 softprops/action-gh-release@v1 - 移除 NFS 挂载依赖,简化部署流程 - 增强错误处理和日志输出
73 lines
2.1 KiB
YAML
73 lines
2.1 KiB
YAML
name: Build One-KVM Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
device_target:
|
|
description: 'Target device name'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- onecloud
|
|
- cumebox2
|
|
- chainedbox
|
|
- vm
|
|
- e900v22c
|
|
- octopus-flanet
|
|
- all
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
container:
|
|
image: node:18
|
|
options: --user root --privileged
|
|
env:
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- /dev:/dev
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
apt-get install -y --no-install-recommends \
|
|
sudo tzdata docker.io qemu-utils qemu-user-static binfmt-support parted e2fsprogs \
|
|
curl tar python3 python3-pip rsync git android-sdk-libsparse-utils coreutils zerofree wget
|
|
apt-get clean
|
|
rm -rf /var/lib/apt/lists/*
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
|
|
echo $TZ > /etc/timezone
|
|
update-binfmts --enable
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
- name: Build image
|
|
run: |
|
|
echo "BUILD_DATE=$(date +%y%m%d)" >> $GITHUB_ENV
|
|
|
|
chmod +x build/build_img.sh
|
|
|
|
echo "Starting build for target: ${{ github.event.inputs.device_target }}"
|
|
bash build/build_img.sh ${{ github.event.inputs.device_target }}
|
|
|
|
echo "Build script finished."
|
|
env:
|
|
CI_PROJECT_DIR: ${{ github.workspace }}
|
|
GITHUB_ACTIONS: true
|
|
OUTPUTDIR: ${{ github.workspace }}/output
|
|
|
|
- name: Create GitHub Release
|
|
id: release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: v${{ env.BUILD_DATE }}-${{ github.event.inputs.device_target }}-${{ github.run_id }}
|
|
name: CI Build ${{ github.event.inputs.device_target }} ${{ env.BUILD_DATE }}
|
|
files: ${{ github.workspace }}/output/*.xz
|
|
prerelease: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |