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 "Установить 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