Files
ipxe/.github/workflows/build.yml
T
Michael Brown 74e0551ac2 [ci] Publish rolling release build artifacts with stable URLs
Publish the binaries built from commits on the master branch under
stable URLs such as:

  https://github.com/ipxe/ipxe/releases/download/rolling/bin/undionly.kpxe

Since filenames such as "ipxe.iso" may exist in each of several build
directories, we implement this as one release tag per build directory.
The GitHub Actions workflow automatically moves the tag to the most
recent commit and overwrites the existing release assets.

One downside of this is that running a local "git log" or similar may
show a large number of uninformative tags of the form "rolling/bin",
"rolling/bin-x86_64-efi", "rolling-arm64-efi", etc, all pointing at
the most recent commit.  This clutter may be hidden using:

  git config --local log.excludeDecoration refs/tags/rolling/*

To avoid the unintentional creation of rolling release tags on forks,
we skip the whole publication job unless the environment variable
ROLLING_PREFIX is defined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2026-01-30 00:03:35 +00:00

279 lines
6.8 KiB
YAML

name: Build
on: push
env:
MAKEFLAGS: "-j4 GITVERSION=${{ github.sha }}"
jobs:
bios:
name: BIOS
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- i386
- x86_64
container:
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
env:
bindir: >-
${{ matrix.arch == 'i386' && 'bin' || 'bin-x86_64-pcbios' }}
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Build
working-directory: src
run: |
make ${{ env.bindir }}/10ec8139.rom \
${{ env.bindir }}/8086100e.mrom \
${{ env.bindir }}/ipxe.dsk \
${{ env.bindir }}/ipxe.iso \
${{ env.bindir }}/ipxe.lkrn \
${{ env.bindir }}/ipxe.pxe \
${{ env.bindir }}/ipxe.usb \
${{ env.bindir }}/undionly.kpxe
- name: Upload
uses: actions/upload-artifact@v6
with:
name: ${{ env.bindir }}
if-no-files-found: error
path: |
src/${{ env.bindir }}/ipxe.lkrn
src/${{ env.bindir }}/ipxe.pxe
src/${{ env.bindir }}/undionly.kpxe
sbi:
name: SBI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- riscv32
- riscv64
container:
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
env:
bindir: bin-${{ matrix.arch }}
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Build
working-directory: src
run: |
make ${{ env.bindir }}/ipxe.pf32 \
${{ env.bindir }}/ipxe.lkrn \
${{ env.bindir }}/ipxe.sbi
- name: Upload
uses: actions/upload-artifact@v6
with:
name: ${{ env.bindir }}
if-no-files-found: error
path: |
src/${{ env.bindir }}/ipxe.lkrn
src/${{ env.bindir }}/ipxe.sbi
uefi:
name: UEFI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- arm32
- arm64
- i386
- loong64
- riscv32
- riscv64
- x86_64
container:
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
env:
bindir: bin-${{ matrix.arch }}-efi
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Build
working-directory: src
run: |
make ${{ env.bindir }}/ipxe.efi \
${{ env.bindir }}/ipxe.iso \
${{ env.bindir }}/ipxe.usb \
${{ env.bindir }}/snponly.efi
- name: Upload
uses: actions/upload-artifact@v6
with:
name: ${{ env.bindir }}
if-no-files-found: error
path: |
src/${{ env.bindir }}/ipxe.efi
src/${{ env.bindir }}/snponly.efi
tests:
name: Tests (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: arm32
exec: qemu-arm-static
- arch: arm64
exec: qemu-aarch64-static
- arch: i386
exec: valgrind
- arch: loong64
exec: qemu-loongarch64-static
- arch: riscv32
exec: qemu-riscv32-static
- arch: riscv64
exec: qemu-riscv64-static
- arch: x86_64
exec: valgrind
container:
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
env:
bindir: bin-${{ matrix.arch }}-linux
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Build
working-directory: src
run: |
make ${{ env.bindir }}/tests.linux
- name: Test
working-directory: src
run: |
${{ matrix.exec }} ${{ env.bindir }}/tests.linux
combine:
name: BIOS + UEFI
runs-on: ubuntu-latest
needs:
- bios
- uefi
container:
image: ghcr.io/ipxe/ipxe-signer
env:
binaries: >-
bin-x86_64-pcbios/ipxe.lkrn
bin-arm32-efi/ipxe.efi
bin-arm64-efi/ipxe.efi
bin-i386-efi/ipxe.efi
bin-loong64-efi/ipxe.efi
bin-riscv32-efi/ipxe.efi
bin-riscv64-efi/ipxe.efi
bin-x86_64-efi/ipxe.efi
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Download
uses: actions/download-artifact@v7
with:
pattern: "{bin-x86_64-pcbios,bin-*-efi}"
- name: Combine
run: |
# Provide an editable placeholder autoexec.ipxe for the USB image
cat > autoexec.ipxe <<'EOF'
#!ipxe
echo
prompt --key 0x02 --timeout 2000 \
Press Ctrl-B for the iPXE command line... \
&& shell || autoboot
EOF
./src/util/genfsimg -o ipxe.iso ${{ env.binaries }}
./src/util/genfsimg -o ipxe.usb -s autoexec.ipxe ${{ env.binaries }}
- name: Upload
uses: actions/upload-artifact@v6
with:
name: bin-combi
if-no-files-found: error
path: |
ipxe.iso
ipxe.usb
publish:
name: Publish
runs-on: ubuntu-latest
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
vars.ROLLING_PREFIX
needs:
- bios
- sbi
- uefi
- tests
- combine
strategy:
fail-fast: false
matrix:
bindir:
- bin
- bin-arm32-efi
- bin-arm64-efi
- bin-combi
- bin-i386-efi
- bin-loong64-efi
- bin-riscv32
- bin-riscv32-efi
- bin-riscv64
- bin-riscv64-efi
- bin-x86_64-efi
- bin-x86_64-pcbios
env:
tag: ${{ vars.ROLLING_PREFIX }}/${{ matrix.bindir }}
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Rolling tag
run: |
git tag -f ${{ env.tag }} ${{ github.sha }}
- name: Download
uses: actions/download-artifact@v7
with:
path: ${{ matrix.bindir }}
name: ${{ matrix.bindir }}
- name: List artifacts
run: |
find ${{ matrix.bindir }} -type f
- name: Update release
env:
GH_TOKEN: ${{ github.token }}
run: |
git push -f origin ${{ env.tag }}
gh release view ${{ env.tag }} >/dev/null 2>&1 || \
gh release create ${{ env.tag }} --prerelease
gh release edit ${{ env.tag }} \
--prerelease \
--tag ${{ env.tag }} \
--target ${{ github.sha }} \
--title ${{ env.tag }} \
--notes "Rolling release of ${{ matrix.bindir }} directory"
gh release upload ${{ env.tag }} --clobber ${{ matrix.bindir }}/*