- образ собирается на каждом PR, который меняет image/, first boot или зависимости панели, а не только по тегу v*; - после сборки проверяются загрузочные записи BIOS/UEFI, autoinstall.yaml и меню GRUB; - перед сборкой освобождается место на раннере, устаревшие запуски отменяются; CI можно запустить вручную. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LEUXMcdZo7b87mjkUsPgg
65 строки
2.1 KiB
YAML
65 строки
2.1 KiB
YAML
name: Build ISO image
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
pull_request:
|
|
paths:
|
|
- "image/**"
|
|
- "scripts/virtuality_firstboot.sh"
|
|
- "web/requirements.txt"
|
|
- ".github/workflows/image.yml"
|
|
workflow_dispatch:
|
|
inputs:
|
|
arch:
|
|
description: "Architecture"
|
|
type: choice
|
|
options: [amd64, arm64, both]
|
|
default: amd64
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: image-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
iso:
|
|
name: ISO ${{ matrix.arch }}
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch: ${{ fromJSON(github.event_name == 'workflow_dispatch' && (inputs.arch == 'both' && '["amd64","arm64"]' || format('["{0}"]', inputs.arch)) || '["amd64","arm64"]') }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- run: sudo apt-get update && sudo apt-get install -y xorriso python3-yaml
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: .cache/iso
|
|
key: ubuntu-iso-${{ matrix.arch }}-${{ hashFiles('image/build-iso.sh') }}
|
|
restore-keys: ubuntu-iso-${{ matrix.arch }}-
|
|
- name: Free disk space
|
|
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL && df -h /
|
|
- run: make iso ARCH=${{ matrix.arch }}
|
|
- name: Check ISO boot records
|
|
run: |
|
|
iso=$(ls dist/*.iso)
|
|
xorriso -indev "$iso" -report_el_torito plain 2>/dev/null | tee /dev/stderr | grep -q "UEFI"
|
|
xorriso -osirrox on -indev "$iso" -extract /autoinstall.yaml autoinstall.yaml -extract /boot/grub/grub.cfg grub.cfg
|
|
python3 -c "import yaml; d = yaml.safe_load(open('autoinstall.yaml')); assert d['autoinstall']['version'] == 1"
|
|
grep -q "Install Virtuality" grub.cfg
|
|
# Ubuntu server ISOs are larger than the 2 GB GitHub release asset limit,
|
|
# so images are published as workflow artifacts.
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: virtuality-iso-${{ matrix.arch }}
|
|
path: |
|
|
dist/*.iso
|
|
dist/*.sha256
|
|
compression-level: 0
|
|
retention-days: 30
|