build-maaxboard-demo-image #14
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-maaxboard-demo-image | |
on: | |
workflow_dispatch: | |
inputs: | |
yocto-image: | |
description: "The yocto image to build" | |
required: false | |
default: "core-image-base" | |
jobs: | |
build-yocto: | |
runs-on: [self-hosted, build] | |
container: | |
image: ghcr.io/avnet-iotconnect/meta-iotconnect/maaxboard-iotc-sdk-kirkstone:latest | |
options: --user pokyuser | |
credentials: | |
username: ${{github.actor}} | |
password: ${{secrets.GHCR_PAT}} | |
steps: | |
- uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: "Run yocto build" | |
run: | | |
cd /home/pokyuser | |
cd MaaXBoard_IoTC_kirkstone | |
set +e | |
MACHINE=maaxboard source sources/meta-maaxboard/tools/maaxboard-setup.sh -b maaxboard/build | |
cd ../../ | |
source sources/poky/oe-init-build-env maaxboard/build/ | |
git config --global user.email "ci-avnet@example.com" | |
git config --global user.name "CI Avnet" | |
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone https://github.com/avnet-iotconnect/meta-iotconnect.git -b kirkstone ../../sources/meta-iotconnect | |
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone https://github.com/avnet-iotconnect/meta-iotconnect-demos.git -b kirkstone ../../sources/meta-iotconnect-demos | |
bitbake-layers add-layer ../../sources/meta-iotconnect | |
bitbake-layers add-layer ../../sources/meta-iotconnect-demos | |
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" bitbake ${{ github.event.inputs.yocto-image }} | |
cd /home/pokyuser/ | |
cp /home/pokyuser/MaaXBoard_IoTC_kirkstone/maaxboard/build/tmp/deploy/images/maaxboard/${{ github.event.inputs.yocto-image }}-maaxboard.wic ${{ github.event.inputs.yocto-image }}-maaxboard-demo.wic | |
gzip -v ${{ github.event.inputs.yocto-image }}-maaxboard-demo.wic | |
shell: bash {0} | |
- uses: hkusu/s3-upload-action@v2.1.0 | |
id: s3-upload | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: 'us-east-1' | |
aws-bucket: 'iotconnect-sdk-images' | |
file-path: /home/pokyuser/${{ github.event.inputs.yocto-image }}-maaxboard-demo.wic.gz | |
destination-dir: '${{ github.head_ref || github.ref_name }}/maaxboard/' | |
bucket-root: "MPU/" | |
public: true | |
output-file-url: 'true' |