humble-build #56
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: humble-build | |
on: | |
push: | |
branches: [ humble ] | |
pull_request: | |
branches: [ humble ] | |
workflow_dispatch: | |
inputs: | |
push_to_docker: | |
description: 'Push packages to docker image?' | |
required: true | |
default: true | |
type: boolean | |
env: | |
ROS_DISTRO: humble | |
jobs: | |
tii-deb-build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
architecture: [amd64, arm64] | |
steps: | |
- name: Checkout rmw_fastrtps | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: ${{ matrix.platform }} | |
- name: Run docker builder | |
env: | |
ROS: 1 | |
IMAGE_NAME: tii_fastdds_builder | |
run: | | |
set -eux | |
mkdir bin | |
git config --global user.email "[email protected]" | |
git config --global user.name "ci" | |
PLATFORM=linux/${{ matrix.platform }} ./build.sh ./bin/ | |
- uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/tiiuae/tii-fastdds-artifacts | |
tags: | | |
type=ref,event=branch,suffix=-${{ matrix.platform }} | |
type=ref,event=pr,suffix=-${{ matrix.platform }} | |
type=semver,pattern={{version}},suffix=-${{ matrix.platform }} | |
type=sha,suffix=-${{ matrix.platform }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build px4-sitl-gazebo-artifacts image and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
file: ./Dockerfile.deb_packages | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fastdds_debs_${{ matrix.platform }} | |
path: bin/*.deb | |
retention-days: 14 | |
merge_images: | |
runs-on: ubuntu-latest | |
needs: tii-deb-build | |
if: (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_to_docker)) | |
steps: | |
- name: Checkout rmw_fastrtps | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/tiiuae/tii-fastdds-artifacts | |
tags: | | |
type=sha | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create combined image | |
run : | | |
docker manifest create $(echo "${{ steps.meta.outputs.tags }}" | head -1) \ | |
$(echo "${{ steps.meta.outputs.tags }}" | head -1)-amd64 \ | |
$(echo "${{ steps.meta.outputs.tags }}" | head -1)-arm64 | |
docker manifest push $(echo "${{ steps.meta.outputs.tags }}" | head -1) |