Skip to content

Update main.yml

Update main.yml #41

Workflow file for this run

name: Yocto Build
on:
push:
branches:
- '**' # Matches all branches
jobs:
build:
runs-on: self-hosted
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
python3-subunit mesa-common-dev zstd liblz4-tool file locales libacl1 \
curl python-is-python3 bmap-tools
sudo locale-gen en_US.UTF-8
- name: Install repo tool
run: |
mkdir -p ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo "${HOME}/bin" >> $GITHUB_PATH
- name: Initialize Yocto Environment
run: |
mkdir -p yocto-astrial
cd yocto-astrial
repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-kirkstone -m imx-5.15.71-2.2.0.xml
mkdir -p .repo/local_manifests
wget --directory-prefix .repo/local_manifests https://raw.githubusercontent.com/System-Electronics/meta-sysele-nxp-5.15.71/main/manifest/astrial-5.15.71.xml
# Extract the repository name and the current branch
REPO_NAME=$(basename "$GITHUB_REPOSITORY")
BRANCH_NAME="${GITHUB_REF_NAME}"
# Add a new remote called "system-local"
sed -i '/<remote fetch="https:\/\/github.com\/System-Electronics" name="system"\/>/a\
<remote fetch="https://github.com/'"${REPO_NAME}"'" name="system-local" revision="'"${BRANCH_NAME}"'" />' .repo/local_manifests/astrial-5.15.71.xml
# Modify only the "meta-sysele-nxp-5.15.71" project to use "system-local"
sed -i 's|<project name="meta-sysele-nxp-5.15.71" remote="system"|<project name="meta-sysele-nxp-5.15.71" remote="system-local"|g' .repo/local_manifests/astrial-5.15.71.xml
# Output the modified XML file for debugging
echo "Modified XML content:"
cat .repo/local_manifests/astrial-5.15.71.xml
repo sync
- name: Generate Build Signature
run: |
# Generate build signature using GitHub secret
if [ "${{ secrets.BUILD_SIGNING_KEY }}" != "" ]; then
# Create a unique signature combining various elements
SIGNATURE_INPUT="${GITHUB_SHA}|${GITHUB_REPOSITORY}|${GITHUB_RUN_ID}|${{ secrets.BUILD_SIGNING_KEY }}"
BUILD_SIGNATURE=$(echo -n "$SIGNATURE_INPUT" | openssl dgst -sha256 -hmac "${{ secrets.BUILD_SIGNING_KEY }}" -hex | cut -d' ' -f2)
else
BUILD_SIGNATURE="unofficial"
fi
echo "BUILD_SIGNATURE=${BUILD_SIGNATURE}" >> $GITHUB_ENV
- name: Build Image
run: |
cd yocto-astrial
source astrial-setup-env -b build
# Pass the signature to bitbake
export BB_ENV_PASSTHROUGH_ADDITIONS="GITHUB_SHA GITHUB_REPOSITORY GITHUB_RUN_ID BUILD_SIGNATURE"
bitbake -c cleanall nnshark
bitbake nnshark
bitbake system-astrial-image
- name: Archive Build Artifacts
uses: actions/upload-artifact@v4
with:
name: yocto-build
path: |
yocto-astrial/build/tmp/deploy/images/astrial-imx8mp/imx-boot-astrial-imx8mp-sd.bin-flash_evk
yocto-astrial/build/tmp/deploy/images/astrial-imx8mp/system-astrial-image-astrial-imx8mp-*.rootfs.wic.zst