-
Notifications
You must be signed in to change notification settings - Fork 80
136 lines (131 loc) · 5.05 KB
/
linux_gcc_edk2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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-
NASM_VERSION: 2.15.05
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [X64, IA32, AARCH64, ARM, RISCV64]
include:
- arch: X64
short: x64
pkgs: python3-distutils uuid-dev
- arch: IA32
short: ia32
pkgs: gcc-multilib python3-distutils uuid-dev
- arch: AARCH64
short: aa64
pkgs: gcc-aarch64-linux-gnu python3-distutils uuid-dev
- arch: ARM
short: arm
pkgs: gcc-arm-linux-gnueabi python3-distutils uuid-dev
- arch: RISCV64
short: riscv64
pkgs: gcc-riscv64-linux-gnu python3-distutils uuid-dev
steps:
- name: Install toolchain
run: sudo apt install ${{ matrix.pkgs }}
- name: Install nasm ${{ env.NASM_VERSION }}
# https://edk2.groups.io/g/devel/topic/89637409#87359
if: matrix.arch == 'X64' || matrix.arch == 'IA32'
run: |
curl -O https://www.nasm.us/pub/nasm/releasebuilds/${{ env.NASM_VERSION }}/nasm-${{ env.NASM_VERSION }}.tar.bz2
tar -xjf nasm-${{ env.NASM_VERSION }}.tar.bz2
cd nasm-${{ env.NASM_VERSION }}
./autogen.sh
./configure --prefix=/usr/local/
make
sudo make install
- 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@v2
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@v2
if: ${{ github.event_name == 'push' }}
with:
name: gcc_edk2
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@v1
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@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: web_files
path: web/*/index.html