Skip to content

add yocto-space-optimize, as poky does #100

add yocto-space-optimize, as poky does

add yocto-space-optimize, as poky does #100

Workflow file for this run

name: CI/CD
on: push
jobs:
build:
name: Build
runs-on:
- self-hosted
- v3
- yocto
container:
image: ghcr.io/hulks/meta-nao-cicd
options: --user=1000:1000
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: meta-nao
- name: Append commit hash to development versions
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: sed -i 's/\(DISTRO_VERSION = "[^"]*\)/\1-${{ github.sha }}/' meta-nao/meta-hulks/conf/distro/HULKs-OS.conf
- name: Extract the version
run: echo "version=$(grep -P 'DISTRO_VERSION\s*=\s*".+"' meta-nao/meta-hulks/conf/distro/HULKs-OS.conf | cut -d\" -f2)" >> $GITHUB_ENV
- name: Checkout Yocto layers
run: kas checkout meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
- name: Populate aldebaran_binaries.tar.gz
run: mkdir -p meta-nao/meta/recipes-support/aldebaran/aldebaran-binaries/ && cp /aldebaran_binaries.tar.gz meta-nao/meta/recipes-support/aldebaran/aldebaran-binaries/
- name: Build NAO image
run: kas build --target nao-image --cmd build meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
- name: Build SDK (x86_64)
run: kas build --target nao-image --cmd populate_sdk meta-nao/kas/base.yml:meta-nao/kas/hulks.yml
- name: Build SDK (aarch64)
run: kas build --target nao-image --cmd populate_sdk meta-nao/kas/base.yml:meta-nao/kas/hulks.yml:meta-nao/kas/aarch64.yml
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: image
path: build/tmp/deploy/images/nao-v6/nao-image-HULKs-OS-${{ env.version }}.ext3.gz.opn
- name: Upload x86_64 SDK artifact
uses: actions/upload-artifact@v4
with:
name: sdk-x86_64
path: build/tmp/deploy/sdk/HULKs-OS-x86_64-toolchain-${{ env.version }}.sh
- name: Upload aarch64 SDK artifact
uses: actions/upload-artifact@v4
with:
name: sdk-aarch64
path: build/tmp/deploy/sdk/HULKs-OS-aarch64-toolchain-${{ env.version }}.sh
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
env:
version: ${{ github.ref_name }}
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Free up disk space
run: sudo rm -rf /usr/local/lib/android
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build development image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: naosdk
tags: ${{ env.version }} ${{ github.sha }}
archs: amd64, arm64
containerfiles: ./naosdk/Containerfile
build-args: version=${{ env.version }}
- name: Push development image to ghcr.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/hulks
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Release NAO image and SDK
uses: softprops/action-gh-release@v2
with:
name: HULKs-OS ${{ github.ref_name }}
body: Flashable image containing HULKs-OS ${{ github.ref_name }} and the corresponding SDK with the toolchain and other tools targeting HULKs-OS, for instructions see https://hulks.de/hulk/setup/overview/
files: |
images/nao-v6/nao-image-HULKs-OS-${{ github.ref_name }}.ext3.gz.opn
sdk/HULKs-OS-x86_64-toolchain-${{ github.ref_name }}.sh
sdk/HULKs-OS-aarch64-toolchain-${{ github.ref_name }}.sh
fail_on_unmatched_files: true