someip2val-build #7
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
# /******************************************************************************** | |
# * Copyright (c) 2022 Contributors to the Eclipse Foundation | |
# * | |
# * See the NOTICE file(s) distributed with this work for additional | |
# * information regarding copyright ownership. | |
# * | |
# * This program and the accompanying materials are made available under the | |
# * terms of the Apache License 2.0 which is available at | |
# * http://www.apache.org/licenses/LICENSE-2.0 | |
# * | |
# * SPDX-License-Identifier: Apache-2.0 | |
# ********************************************************************************/ | |
name: someip2val-build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
build_binaries: | |
description: 'Build Binaries' | |
required: false | |
default: 'false' | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
# Needed as default_workflow_permissions is "read" | |
permissions: | |
packages: write | |
jobs: | |
check_ghcr_push: | |
uses: eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@2 | |
secrets: inherit | |
build: | |
name: Build Binaries | |
# build if explicitly requested or merging to main | |
if: ${{ github.event.inputs.build_binaries == 'true' || (needs.check_ghcr_push.outputs.push == 'true') }} | |
# reduce runtime requirements from ubuntu, ubuntu-18.04 fails for aarch64 | |
runs-on: ubuntu-20.04 | |
needs: check_ghcr_push | |
strategy: | |
matrix: | |
target-arch: [x86_64, aarch64] | |
fail-fast: true | |
steps: | |
- name: Install Pre-requisities | |
run: | | |
sudo apt-get update -qqy && \ | |
sudo apt-get install -qqy --no-install-recommends \ | |
cmake g++ build-essential \ | |
g++-aarch64-linux-gnu binutils-aarch64-linux-gnu \ | |
jq python3 python3-pip python3-setuptools && | |
pip3 install conan==1.55.0 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run build | |
working-directory: ${{github.workspace}} | |
run: ./build-release.sh ${{ matrix.target-arch }} | |
- name: Upload Binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: someip-provider_${{ matrix.target-arch }}_release | |
path: | | |
${{github.workspace}}/target/${{ matrix.target-arch }}/release/install/bin | |
${{github.workspace}}/target/${{ matrix.target-arch }}/release/install/lib/libvsomeip*.so.3 | |
if-no-files-found: error | |
build_docker: | |
# reduce runtime requirements from ubuntu, ubuntu-18.04 fails for aarch64 | |
runs-on: ubuntu-20.04 | |
name: Build Docker | |
needs: check_ghcr_push | |
steps: | |
- name: Check Setup | |
env: | |
OUT_GHCR_PUSH: ${{ needs.check_ghcr_push.outputs.push }} | |
OUT_USER_NAME: ${{ github.repository_owner }} | |
OUT_EVENT_NAME: ${{ github.event_name }} | |
run: | | |
echo | |
echo "### ghcr_push : $OUT_GHCR_PUSH" | |
echo "### username : $OUT_USER_NAME" | |
echo "### event_name : $OUT_EVENT_NAME" | |
echo | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
if: needs.check_ghcr_push.outputs.push == 'true' | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/someip-provider | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: "Build someip2val container and push to ghcr.io" | |
if: needs.check_ghcr_push.outputs.push == 'true' | |
id: image_build_ghcr | |
uses: docker/build-push-action@v5 | |
with: | |
pull: false | |
push: true | |
file: ./Dockerfile | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
ttl.sh/eclipse-kuksa/kuksa-someip-provider/someip-provider-${{github.sha}} | |
ttl.sh/kuksa.val.feeders/someip-feeder-${{github.sha}} | |
labels: ${{ steps.meta.outputs.labels }} | |
# Provenance to solve that an unknown/unkown image is shown on ghcr.io | |
# Same problem as described in https://github.com/orgs/community/discussions/45969 | |
provenance: false | |
- name: "Build someip2val container and push to ttl.sh" | |
if: needs.check_ghcr_push.outputs.push == 'false' | |
id: image_build_ttl | |
uses: docker/build-push-action@v5 | |
with: | |
pull: false | |
push: true | |
file: ./Dockerfile | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
tags: | | |
ttl.sh/eclipse-kuksa/kuksa-someip-provider/someip-provider-${{github.sha}} | |
labels: ${{ steps.meta.outputs.labels }} | |
# Provenance to solve that an unknown/unkown image is shown on ghcr.io | |
# Same problem as described in https://github.com/orgs/community/discussions/45969 | |
provenance: false |