sync with imx8mp / switch from patch files to git repos forking nxp #14
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [ "develop-lf-6.6.52-2.2.0" ] | |
| pull_request: | |
| branches: [ "develop-lf-6.6.52-2.2.0" ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| prepare_container: | |
| runs-on: self-hosted | |
| outputs: | |
| uid: ${{ steps.uid_step.outputs.userid }} | |
| gid: ${{ steps.uid_step.outputs.groupid }} | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Get user id/group | |
| id: uid_step | |
| run: | | |
| echo "userid=$(id -u)" >> "$GITHUB_OUTPUT" | |
| echo "groupid=$(id -g)" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| buildkitd-config: /etc/docker/cibuilder.toml | |
| - name: Login to Docker Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ciserver.ci:5000 | |
| username: ${{ secrets.CI_CACHE_REGISTRY_LOGIN }} | |
| password: ${{ secrets.CI_CACHE_REGISTRY_PASSWORD }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: docker | |
| push: true | |
| tags: ciserver.ci:5000/${{ github.repository_id }}:lf-6.6.52-2.2.0 | |
| cache-from: type=registry,ref=ciserver.ci:5000/${{ github.repository_id }}:cache | |
| cache-to: type=registry,ref=ciserver.ci:5000/${{ github.repository_id }}:cache,mode=max | |
| build-args: | | |
| USER_ID=${{ steps.uid_step.outputs.userid }} | |
| GROUP_ID=${{ steps.uid_step.outputs.groupid }} | |
| build_images: | |
| needs: prepare_container | |
| runs-on: self-hosted | |
| timeout-minutes: 1080 | |
| container: | |
| image: ciserver.ci:5000/${{ github.repository_id }}:lf-6.6.52-2.2.0 | |
| credentials: | |
| username: ${{ secrets.CI_CACHE_REGISTRY_LOGIN }} | |
| password: ${{ secrets.CI_CACHE_REGISTRY_PASSWORD }} | |
| options: --user "${{ needs.prepare_container.outputs.uid }}:${{ needs.prepare_container.outputs.gid }}" | |
| outputs: | |
| build_tag: ${{ steps.tag_step.outputs.build_tag }} | |
| steps: | |
| - name: Checkout pull-request version of imx8mm_build | |
| uses: actions/checkout@v4 | |
| - name: Get build tag | |
| shell: bash -e {0} | |
| id: tag_step | |
| run: | | |
| build_tag=$(date +%Y-%m-%d)_$(git rev-parse --short HEAD) | |
| echo "build_tag=$build_tag" >> "$GITHUB_OUTPUT" | |
| - name: Build | |
| shell: bash -e {0} | |
| run: | | |
| export BR_MIRROR="http://ciserver.ci:8000/cimirror/buildroot_mirror" | |
| env BR2_PRIMARY_SITE="$BR_MIRROR" SHALLOW=true BOOTSOURCE=mmc-data DISTRO=buildroot ./runme.sh | |
| env BR2_PRIMARY_SITE="$BR_MIRROR" SHALLOW=true BOOTSOURCE=mmc-boot0 DISTRO=buildroot ./runme.sh | |
| env BR2_PRIMARY_SITE="$BR_MIRROR" SHALLOW=true BOOTSOURCE=mmc-boot1 DISTRO=buildroot ./runme.sh | |
| env BR2_PRIMARY_SITE="$BR_MIRROR" SHALLOW=true BOOTSOURCE=mmc-data DISTRO=debian ./runme.sh | |
| env BR2_PRIMARY_SITE="$BR_MIRROR" SHALLOW=true BOOTSOURCE=mmc-boot0 DISTRO=debian ./runme.sh | |
| env BR2_PRIMARY_SITE="$BR_MIRROR" SHALLOW=true BOOTSOURCE=mmc-boot1 DISTRO=debian ./runme.sh | |
| - name: Select artifacts for publishing | |
| shell: bash -e {0} | |
| run: | | |
| mkdir deploy | |
| cp -L images/linux-*.tar deploy/ | |
| cp -L images/linux-headers-*.tar deploy/ | |
| cp -L images/*.img deploy/ | |
| cp -L images/*.bin deploy/ | |
| xz -9 deploy/* | |
| ls -lh deploy | |
| - name: Deploy to the local minio storage | |
| uses: yakubique/minio-upload@v1.1.3 | |
| with: | |
| endpoint: http://ciserver.ci:9000 | |
| insecure: true | |
| access_key: ${{ secrets.CI_CACHE_MINIO_ACCESS }} | |
| secret_key: ${{ secrets.CI_CACHE_MINIO_SECRET }} | |
| bucket: cipublish | |
| source: ./deploy | |
| target: "/${{ github.repository_id }}/${{ steps.tag_step.outputs.build_tag }}" | |
| recursive: true | |
| publish_images: | |
| needs: build_images | |
| runs-on: self-hosted | |
| if: github.ref == 'refs/heads/develop-lf-6.6.52-2.2.0' && github.event_name != 'pull_request' | |
| steps: | |
| - name: Download an artifacts from MinIO | |
| uses: yakubique/minio-download@v1.1.1 | |
| with: | |
| endpoint: http://ciserver.ci:9000 | |
| insecure: true | |
| access_key: ${{ secrets.CI_CACHE_MINIO_ACCESS }} | |
| secret_key: ${{ secrets.CI_CACHE_MINIO_SECRET }} | |
| bucket: cipublish | |
| source: "/${{ github.repository_id }}/${{ needs.build_images.outputs.build_tag }}/" | |
| target: "." | |
| recursive: true | |
| - name: Upload to S3 | |
| uses: shallwefootball/upload-s3-action@v1.3.3 | |
| with: | |
| aws_key_id: ${{ secrets.IMAGES_S3_ACCESS }} | |
| aws_secret_access_key: ${{ secrets.IMAGES_S3_SECRET }} | |
| aws_bucket: ${{ secrets.IMAGES_S3_BUCKET }} | |
| endpoint: ${{ secrets.IMAGES_S3_HOST }} | |
| source_dir: deploy | |
| destination_dir: IMX8/imx8mm_build/lf-6.6.52-2.2.0/${{ needs.build_images.outputs.build_tag }} |