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 }}