Add LoongArch64 compilation support #35
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 with EDK2) build | |
on: | |
workflow_dispatch: | |
branches: [master] | |
push: | |
branches: [master] | |
tags: | |
- '**' | |
pull_request: | |
branches: [master] | |
env: | |
BUILD_TYPE: RELEASE | |
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- | |
LOONGARCH64_TOOLCHAIN_TAG: 2024.11.01 | |
LOONGARCH64_TOOLCHAIN_NAME: x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz | |
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: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set version | |
id: set_version | |
run: echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT | |
- name: Create version.h file | |
run: | | |
git update-index --skip-worktree version.h | |
echo '#define VERSION_STRING L"${{ steps.set_version.outputs.version }}"' > version.h | |
- name: Install toolchain | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends ${{ matrix.pkgs }} | |
if [[ "${{ matrix.arch }}" == "LOONGARCH64" ]]; then | |
curl -L -O https://github.com/loongson/build-tools/releases/download/${LOONGARCH64_TOOLCHAIN_TAG}/${LOONGARCH64_TOOLCHAIN_NAME} | |
tar -xJf ${LOONGARCH64_TOOLCHAIN_NAME} | |
echo "$PWD/cross-tools/bin" >> "$GITHUB_PATH" | |
fi | |
- name: Set up EDK2 | |
run: | | |
git clone --recursive https://github.com/tianocore/edk2.git | |
make -C edk2/BaseTools | |
- name: Build UEFI bootloader | |
run: | | |
export WORKSPACE=$PWD | |
export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/edk2 | |
source edk2/edksetup.sh | |
build -a ${{ matrix.arch }} -b ${BUILD_TYPE} -t GCC5 -p uefi-ntfs.dsc | |
mv $WORKSPACE/Build/${BUILD_TYPE}_GCC5/${{ matrix.arch }}/uefi-ntfs.efi $WORKSPACE/boot${{ matrix.short }}.efi | |
- name: Display SHA-256 | |
run: sha256sum *.efi | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.short }} | |
path: ./*.efi | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: "**UEFI:NTFS ${{ steps.set_version.outputs.version }}**" | |
files: ./*.efi |