-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (106 loc) · 3.41 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: humble-build
on:
push:
branches: [ humble ]
paths-ignore:
- 'README.md'
pull_request:
branches: [ humble ]
workflow_dispatch:
inputs:
push_to_docker:
description: 'Push packages to docker image?'
required: true
default: true
type: boolean
permissions:
contents: read
packages: write
env:
ROS_DISTRO: humble
jobs:
tii-deb-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
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.architecture }}
- name: Run deb package build
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.architecture }} ./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.architecture }}
type=ref,event=pr,suffix=-${{ matrix.architecture }}
type=semver,pattern={{version}},suffix=-${{ matrix.architecture }}
type=sha,suffix=-${{ matrix.architecture }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build tii-fastdds-artifacts image and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/${{ matrix.architecture }}
file: ./Dockerfile.deb_packages
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: fastdds_debs_${{ matrix.architecture }}
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 : |
echo "Debug: Tags are ${{ steps.meta.outputs.tags }}"
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)