add U-Boot for Orange Pi 5 #19
Workflow file for this run
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: Build U-Boot for Orange Pi 5 | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
env: | |
U_BOOT_VERSION: v2024.04 | |
BUILDX_NO_DEFAULT_ATTESTATIONS: 1 | |
jobs: | |
build: | |
name: Build U-Boot | |
runs-on: | |
- self-hosted | |
- orangepi5-u-boot | |
strategy: | |
max-parallel: 1 | |
matrix: | |
board: | |
- title: Orange Pi 5 | |
name: orangepi5 | |
defconfig: orangepi-5-rk3588s | |
- title: Orange Pi 5 Plus | |
name: orangepi5-plus | |
defconfig: orangepi-5-plus-rk3588 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to registry | |
uses: docker/login-action@v3 | |
with: | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver: remote | |
endpoint: tcp://buildkit:1234 | |
- name: Cache U-Boot build | |
id: cache-u-boot-build | |
uses: actions/cache@v4 | |
with: | |
save-always: true | |
path: u-boot-build | |
key: u-boot-build-${{ github.ref_name }}-${{ matrix.board.name }} | |
- name: Inject U-Boot build cache into buildx | |
uses: reproducible-containers/[email protected] | |
with: | |
cache-source: u-boot-build | |
cache-target: /u-boot/build-${{ matrix.board.name }} | |
skip-extraction: ${{ steps.cache-u-boot-build.outputs.cache-hit }} | |
- name: Get commit date | |
id: commit-date | |
run: echo SOURCE_DATE_EPOCH=$(git log $(git rev-list --max-parents=0 HEAD) --pretty=%ct) >> $GITHUB_OUTPUT | |
- name: Build U-Boot for ${{ matrix.board.title }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
outputs: type=local,dest=. | |
cache-from: type=gha,scope=${{ matrix.board.name }} | |
cache-to: type=gha,mode=max,scope=${{ matrix.board.name }} | |
build-args: | | |
SOURCE_DATE_EPOCH=${{ steps.commit-date.outputs.SOURCE_DATE_EPOCH }} | |
BOARD=${{ matrix.board.name }} | |
DEFCONFIG=${{ matrix.board.defconfig }} | |
U_BOOT_VERSION=${{ env.U_BOOT_VERSION }} | |
push: false | |
- name: Push artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: u-boot-${{ matrix.board.name }} | |
path: "*.bin" | |
release: | |
name: Release U-Boot | |
needs: build | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} | |
runs-on: | |
- self-hosted | |
- orangepi5-u-boot | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ github.ref_name }} - U-Boot ${{ env.U_BOOT_VERSION }} | |
body: "**U-Boot ${{ env.U_BOOT_VERSION }} for Orange Pi 5 (and variants)**" | |
makeLatest: "legacy" | |
generateReleaseNotes: true | |
artifacts: "**/*.bin" |