-
Notifications
You must be signed in to change notification settings - Fork 23
72 lines (61 loc) · 2.05 KB
/
build-publish-debian-packages.yml
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
name: Build publish debian packages
on:
release:
types: [published]
pull_request:
branches:
- '*'
jobs:
build:
name: Build debian packages
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64, linux/arm64]
distro:
- ubuntu: jammy
ros2: humble
- ubuntu: jammy
ros2: rolling
- ubuntu: focal
ros2: foxy
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set version
if: ${{ github.event_name == 'release' }}
run: sed -i "s/<version>.*<\/version>/<version>${{ github.event.release.tag_name }}<\/version>/" px4_ros2_cpp/package.xml
- name: Build build environment
run: |
docker build . -f Dockerfile.debian-buildenv \
--platform ${{ matrix.platform }} \
--build-arg="ROS2_DISTRO=${{ matrix.distro.ros2 }}" \
--build-arg="UBUNTU_DISTRO=${{ matrix.distro.ubuntu }}" \
-t buildenv:current
- name: Build debian packages
working-directory: px4_ros2_cpp
run: |
docker run --rm -v .:/work --platform ${{ matrix.platform }} buildenv:current
- name: Upload artifacts to github actions
uses: actions/upload-artifact@v3
with:
name: debian-packages
path: px4_ros2_cpp/output/*.deb
- name: Generate upload information
run: |
echo "DEBIAN_PACKAGE=$(ls px4_ros2_cpp/output/ | grep '\.deb')" >> $GITHUB_ENV
- run: |
echo "DEBIAN PACKAGE FILE: ${{ env.DEBIAN_PACKAGE }}"
- name: Push package to cloudsmith
if: ${{ github.event_name == 'release' }}
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.AUTERION_CI_CLOUDSMITH_API_KEY }}
command: 'push'
format: 'deb'
owner: auterion
repo: public
distro: ubuntu
release: ${{ matrix.distro.ubuntu }}
file: px4_ros2_cpp/output/${{ env.DEBIAN_PACKAGE }}