Skip to content

Commit

Permalink
Combine ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruhlmann committed Jul 15, 2024
1 parent 4c24d0f commit 9b2d3f1
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 49 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/build.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build UEFI Application

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up environment
run: |
sudo apt-get update
sudo apt-get install -y build-essential gcc gnu-efi mtools parted ovmf qemu-system-x86
- name: Determine system paths
id: system-paths
run: |
echo "INCLUDE_DIRS=$(dirname $(find /usr/include -name efi.h | head -n 1))" >> $GITHUB_OUTPUT
echo "LD_OBJ=$(find /usr/lib -name crt0-efi-x86_64.o | head -n 1)" >> $GITHUB_OUTPUT
echo "EFI_LDS=$(find /usr/lib -name elf_x86_64_efi.lds | head -n 1)" >> $GITHUB_OUTPUT
echo "BIOS_FD=$(find /usr/share -name OVMF.fd | head -n 1)" >> $GITHUB_OUTPUT
echo "LD_EXTRA=-L$(find /usr/lib -name libgnuefi.a -exec dirname {} \; | head -n 1)" >>$GITHUB_OUTPUT
- name: Build UEFI application
run: |
make main.efi reboot.img \
INCLUDE_DIRS="${{ steps.system-paths.outputs.INCLUDE_DIRS }}" \
LD_OBJ="${{ steps.system-paths.outputs.LD_OBJ }}" \
EFI_LDS="${{ steps.system-paths.outputs.EFI_LDS }}" \
BIOS_FD="${{ steps.system-paths.outputs.BIOS_FD }}" \
LD_EXTRA="${{ steps.system-paths.outputs.LD_EXTRA }}"
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: reboot-artifacts
path: |
main.efi
reboot.img
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: reboot-artifacts
path: ./artifacts

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This release includes the compiled UEFI application and the disk image.
draft: false
prerelease: false

- name: Upload main.efi to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/main.efi
asset_name: main.efi
asset_content_type: application/octet-stream

- name: Upload reboot.img to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/reboot.img
asset_name: reboot.img
asset_content_type: application/octet-stream

0 comments on commit 9b2d3f1

Please sign in to comment.