version 1.11 #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux, gcc, EDK2 | |
on: | |
push: | |
paths-ignore: | |
- '.gitignore' | |
- '.gitattributes' | |
- '**.cmd' | |
- '!set_grub_cpu.cmd' | |
- '**.md' | |
- '**.sh' | |
- '!set_grub_cpu.sh' | |
- '**.txt' | |
- '**.vbs' | |
pull_request: | |
paths-ignore: | |
- '.gitignore' | |
- '.gitattributes' | |
- '**.cmd' | |
- '!set_grub_cpu.cmd' | |
- '**.md' | |
- '**.sh' | |
- '!set_grub_cpu.sh' | |
- '**.txt' | |
- '**.vbs' | |
env: | |
BUILD_TYPE: RELEASE | |
COMPILER: GCC5 | |
GCC5_ARM_PREFIX: arm-linux-gnueabi- | |
GCC5_AARCH64_PREFIX: aarch64-linux-gnu- | |
GCC5_RISCV64_PREFIX: riscv64-linux-gnu- | |
GCC5_LOONGARCH64_PREFIX: loongarch64-unknown-linux-gnu- | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
arch: [X64, IA32, AARCH64, ARM, RISCV64, LOONGARCH64] | |
include: | |
- arch: X64 | |
short: x64 | |
pkgs: nasm python3-setuptools uuid-dev | |
- arch: IA32 | |
short: ia32 | |
pkgs: gcc-multilib nasm python3-setuptools uuid-dev | |
- arch: AARCH64 | |
short: aa64 | |
pkgs: gcc-aarch64-linux-gnu python3-setuptools uuid-dev | |
- arch: ARM | |
short: arm | |
pkgs: gcc-arm-linux-gnueabi python3-setuptools uuid-dev | |
- arch: RISCV64 | |
short: riscv64 | |
pkgs: gcc-riscv64-linux-gnu python3-setuptools uuid-dev | |
- arch: LOONGARCH64 | |
short: loongarch64 | |
pkgs: gcc-multilib python3-setuptools uuid-dev | |
steps: | |
- name: Install toolchain | |
run: | | |
sudo apt-get update | |
sudo apt-get install ${{ matrix.pkgs }} | |
if [[ "${{ matrix.arch }}" == "LOONGARCH64" ]]; then | |
curl -L -O https://github.com/loongson/build-tools/releases/download/2024.11.01/x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz | |
tar -xJf x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz | |
echo "$PWD/cross-tools/bin" >> "$GITHUB_PATH" | |
fi | |
- name: Fix missing Risc-V header | |
if: matrix.arch == 'RISCV64' | |
run: sudo ln -s /usr/riscv64-linux-gnu/include/gnu/stubs-lp64d.h /usr/riscv64-linux-gnu/include/gnu/stubs-lp64.h | |
- name: Set up EDK2 | |
run: | | |
git clone --recursive https://github.com/tianocore/edk2.git | |
make -C edk2/BaseTools | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
path: edk2/EfiFsPkg | |
- name: Patch GRUB | |
run: | | |
cd edk2/EfiFsPkg/grub | |
git apply ../0001-GRUB-fixes.patch | |
- name: Build UEFI drivers | |
run: | | |
cd edk2 | |
source edksetup.sh | |
./EfiFsPkg/set_grub_cpu.sh ${{ matrix.arch }} | |
build -a ${{ matrix.arch }} -b ${{ env.BUILD_TYPE }} -t ${{ env.COMPILER }} -p EfiFsPkg/EfiFsPkg.dsc | |
for f in Build/EfiFs/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.arch }}/*.efi; do mv "$f" "${f%.efi}_${{ matrix.short }}.efi"; done | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
name: gcc_edk2_${{ matrix.short }} | |
path: edk2/Build/EfiFs/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.arch }}/*.efi | |
- name: Display SHA-256 | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
mv edk2/Build/EfiFs/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.arch }}/*.efi . | |
sha256sum *.efi | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
files: ./*.efi | |
- name: Create web artifacts | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
GIT_VERSION=$(git --git-dir edk2/EfiFsPkg/.git describe --tags --abbrev=0) | |
DIR_VERSION=${GIT_VERSION:1} | |
mkdir -p web/${{ matrix.short }} | |
curl -L https://raw.githubusercontent.com/pbatard/efifs/gh-pages/downloads/header.html -o web/${{ matrix.short }}/index.html | |
printf "<pre><img src=\"/icons/blank.png\" alt=\"Icon\" width=\"32\" height=\"32\"> Name Last modified Size Description<hr><a href=\"/downloads/efifs-%s/\"><img src=\"/icons/back.png\" alt=\"[PARENTDIR]\" width=\"32\" height=\"32\"></a> <a href=\"/downloads/efifs-%s/\">Parent Directory</a> -\n" ${DIR_VERSION} ${DIR_VERSION} >> web/${{ matrix.short }}/index.html | |
for f in *.efi; do | |
TIMESTAMP=$(date -r $f "+%Y-%m-%d %H:%M"); | |
SIZE=$(du --apparent-size -sh $f | awk '{ print $1 }'); | |
LINK=https://github.com/pbatard/efifs/releases/download/${GIT_VERSION}/$f; | |
FILE_AND_TAG="$f</a>"; | |
printf "<a href=\"%s\"><img src=\"/icons/uefi.svg\" alt=\"[EFI]\" width=\"32\" height=\"32\"></a> <a href=\"%s\">%-31s%-19s%-5s\n" "${LINK}" "${LINK}" "${FILE_AND_TAG}" "${TIMESTAMP}" "${SIZE}" >> web/${{ matrix.short }}/index.html; | |
done | |
printf "<hr></pre>\n </body>\n</html>\n" >> web/${{ matrix.short }}/index.html | |
- name: Upload web artifacts | |
uses: actions/upload-artifact@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: web_files_${{ matrix.arch }} | |
path: web/*/index.html | |
merge-artifacts: | |
runs-on: ubuntu-24.04 | |
needs: build | |
steps: | |
- name: Merge Artifacts | |
uses: actions/upload-artifact/merge@v4 | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
with: | |
name: gcc_edk2 | |
delete-merged: true | |
- name: Merge Web Artifacts | |
uses: actions/upload-artifact/merge@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: web_files | |
delete-merged: true |