forked from rhboot/shim
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (85 loc) · 3.05 KB
/
ipxe.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
name: iPXE
on:
push:
branches:
- ipxe*
tags:
- ipxe*
env:
SHIMURL: ${{ github.server_url }}/rhboot/shim
IPXEURL: ${{ github.server_url }}/${{ github.repository }}
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Identify upstream tag
run: |
BASECOMMIT=$(git merge-base origin/main HEAD)
SHIMTAG=$(git describe ${BASECOMMIT})
if [ ! $(git tag -l "${SHIMTAG}") ] ; then
echo "Not branched from an upstream tag"
exit 1
fi
echo SHIMTAG=${SHIMTAG} >> ${GITHUB_ENV}
- name: Install packages
run: |
sudo apt update
sudo apt install -y -o Acquire::Retries=50 \
gcc-aarch64-linux-gnu gcab dos2unix
- name: Build (x64)
run: |
mkdir build-x64
make -C build-x64 -f ../Makefile TOPDIR=..
cp build-x64/shimx64.efi ipxe-shimx64.efi
- name: Build (aa64)
run: |
mkdir build-aa64
make -C build-aa64 -f ../Makefile TOPDIR=.. \
CROSS_COMPILE=aarch64-linux-gnu-
cp build-aa64/shimaa64.efi ipxe-shimaa64.efi
- name: Generate .cab
run: |
gcab -c unsigned.cab ipxe-shimx64.efi ipxe-shimaa64.efi
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: unsigned.cab
path: unsigned.cab
if-no-files-found: error
- name: Get release version
if: startsWith(github.event.ref, 'refs/tags/ipxe-')
run: |
IPXETAG=${GITHUB_REF/refs\/tags\//}
IPXEVER=${IPXETAG/ipxe-/}
IPXEDATE=$(git show -s --format='%as')
echo IPXETAG=${IPXETAG} >> ${GITHUB_ENV}
echo IPXEVER=${IPXEVER} >> ${GITHUB_ENV}
echo IPXEDATE=${IPXEDATE} >> ${GITHUB_ENV}
- name: Generate changelog
run: |
echo -e "Based on upstream" \
"[shim-${SHIMTAG}](${SHIMURL}/releases/tag/${SHIMTAG})\n" \
> IPXECHANGES.md
echo -e "## Included changes\n" >> IPXECHANGES.md
git log origin/main..HEAD \
--format="format:* [%s](${IPXEURL}/commit/%h)" >> IPXECHANGES.md
DOWNLOADURL=${IPXEURL}/releases/download/${IPXETAG}
echo -e "\n\n## Downloads\n" >> IPXECHANGES.md
echo "* [ipxe-shimx64.efi](${DOWNLOADURL}/ipxe-shimx64.efi)" \
"(x86_64)" >> IPXECHANGES.md
echo "* [ipxe-shimaa64.efi](${DOWNLOADURL}/ipxe-shimaa64.efi)" \
"(aarch64)" >> IPXECHANGES.md
- name: Create release
if: startsWith(github.event.ref, 'refs/tags/ipxe-')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${IPXETAG} --verify-tag --prerelease \
--title "${IPXEVER} (${IPXEDATE})" --notes-file IPXECHANGES.md \
ipxe-shimx64.efi ipxe-shimaa64.efi unsigned.cab