-
Notifications
You must be signed in to change notification settings - Fork 243
73 lines (63 loc) · 2.33 KB
/
Copy pathpackage.yml
File metadata and controls
73 lines (63 loc) · 2.33 KB
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
name: Package (.deb)
# Builds Debian packages of px4_msgs for amd64 and arm64 using the bundled
# builder container (see container/Dockerfile and scripts/build_deb_host.sh).
# Packages are uploaded as build artifacts and, on a GitHub release, attached
# to the release. This automates the package generation step towards publishing
# official PX4-hosted packages.
on:
release:
types: [published]
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: write
jobs:
deb:
name: "Build .deb (${{ matrix.ros2_distro }} / ${{ matrix.arch }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ros2_distro: [humble, jazzy, kilted, rolling, lyrical]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v7
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build the px4_msgs-builder image
uses: docker/build-push-action@v7
with:
context: .
file: container/Dockerfile
platforms: linux/${{ matrix.arch }}
build-args: |
ROS_DISTRO=${{ matrix.ros2_distro }}
tags: px4io/px4_msgs-builder:${{ matrix.ros2_distro }}
load: true
# Cache the builder image layers (apt/rosdep/bloom install) across runs.
cache-from: type=gha,scope=${{ matrix.ros2_distro }}-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.ros2_distro }}-${{ matrix.arch }}
- name: Build the Debian package
run: |
mkdir -p out
docker run --rm --platform "linux/${{ matrix.arch }}" \
-v "${{ github.workspace }}":/src \
-v "${{ github.workspace }}/out":/artifacts \
"px4io/px4_msgs-builder:${{ matrix.ros2_distro }}" \
/usr/local/bin/build.sh
ls -lh out/
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: px4_msgs-deb-${{ matrix.ros2_distro }}-${{ matrix.arch }}
path: out/*.deb
if-no-files-found: error
- name: Attach packages to release
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" out/*.deb --clobber