Skip to content

Commit

Permalink
Merge pull request #1 from ubicloud/pykello/release
Browse files Browse the repository at this point in the history
Automated releases
  • Loading branch information
pykello committed Mar 8, 2024
2 parents 3645ed4 + 22735aa commit 6248d53
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
name: edk2 build
on: [create,push]
on: [push,workflow_dispatch]

jobs:
build:
name: Build
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runs-on: [ubicloud, ubicloud-arm]
runs-on: ${{matrix.runs-on}}
include:
- runner: ubicloud-standard-2
platform: x64
edk2_version: edk2-stable202402
edk2_commit: edc6681206c1a8791981a2f911d2fb8b3d2f5768
- runner: ubicloud-standard-2-arm
edk2_version: edk2-stable202211
edk2_commit: fff6d81270b57ee786ea18ad74f43149b9f03494
platform: arm64

steps:
- name: Code checkout
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y install uuid-dev iasl build-essential python3-distutils git libbrotli-dev nasm
- name: Build edk2
run: ./build-edk2
run: EDK2_COMMIT=${{ matrix.edk2_commit}} ./build-edk2
- name: List produced files
run: ls
- uses: ncipollo/release-action@v1
if: github.event_name == 'workflow_dispatch'
with:
artifacts: "${{ github.workspace }}/CLOUDHV-${{ matrix.platform }}.fd"
body: "Release ${{ matrix.edk2_version }}-${{ matrix.platform }}"
name: "${{ matrix.edk2_version }}-${{ matrix.platform }}"
tag: "${{ matrix.edk2_version }}-${{ matrix.platform }}"
allowUpdates: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
edk2_build/*
*.fd
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ the following in a Debian or Ubuntu environment:
# If you need build dependencies:
$ sudo apt-get update && sudo apt-get -y install uuid-dev iasl build-essential python3-distutils git libbrotli-dev nasm

$ ./build-edk2
$ EDK2_COMMIT=edc6681206c1a8791981a2f911d2fb8b3d2f5768 ./build-edk2
```
17 changes: 12 additions & 5 deletions build-edk2
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
# sudo -- bash -c 'apt-get update && apt-get install -y make gcc g++ flex bison nasm m4 uuid-dev g++'

WORKLOADS_DIR="$(pwd)"
EDK2_COMMIT="8736b8fdca85e02933cdb0a13309de14c9799ece"
EDK2_PLAT_COMMIT="b5fa396700e728c0e18b512229226f65337bf74a"
EDK2_PLAT_COMMIT="103c88ba5b0c6259fc674e6358c68a85e882e41b"
ACPICA_COMMIT="f16a0b4d0f0edd7b78a332fcf507be2187fac21e"

set -uex

if [ -z "$EDK2_COMMIT" ]; then
echo "Error: EDK2_COMMIT is not set." >&2
exit 1
fi

# Checkout source code of a GIT repo with specified branch and commit
# Args:
# $1: Target directory
Expand Down Expand Up @@ -88,10 +92,11 @@ build_edk2() {
! -f "$EDK2_PLAT_DIR/.built" ||
! -f "$ACPICA_DIR/.built" ]]; then
pushd "$EDK2_BUILD_DIR" || exit

# Build
make -C acpica -j "$(nproc)"
# shellcheck disable=SC1091

# edk2setup relies on null expansions.
set -xe +u
source edk2/edksetup.sh
Expand All @@ -102,10 +107,12 @@ build_edk2() {

if [ "$architecture" = "x86_64" ]; then
build -a X64 -t GCC5 -p OvmfPkg/CloudHv/CloudHvX64.dsc -b RELEASE -n 0
cp Build/CloudHvX64/RELEASE_GCC5/FV/CLOUDHV.fd "$WORKLOADS_DIR"
cp Build/CloudHvX64/RELEASE_GCC5/FV/CLOUDHV.fd "$WORKLOADS_DIR/CLOUDHV-x64.fd"
elif [ "$architecture" = "aarch64" ]; then
# We don't need the "Press ESCAPE for boot options" prompt
sed -i 's/\(gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|\)[0-9]\+/\10/g' edk2/ArmVirtPkg/ArmVirtCloudHv.dsc
build -a AARCH64 -t GCC5 -p ArmVirtPkg/ArmVirtCloudHv.dsc -b RELEASE -n 0
cp Build/ArmVirtCloudHv-AARCH64/RELEASE_GCC5/FV/CLOUDHV_EFI.fd "$WORKLOADS_DIR"
cp Build/ArmVirtCloudHv-AARCH64/RELEASE_GCC5/FV/CLOUDHV_EFI.fd "$WORKLOADS_DIR/CLOUDHV-arm64.fd"
else
echo "Unsupported architecture: $architecture"
fi
Expand Down

0 comments on commit 6248d53

Please sign in to comment.