-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (120 loc) · 6 KB
/
build.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
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
122
123
124
125
126
127
# build docker files with the gsplines installed
name: compilation
on: push
jobs:
deploy:
name: build image
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
docker_image:
- image_name: "rafa606/ros-gsplines-vim-dev:noetic"
base_image: "rafa606/ros-vim:noetic"
ros_distro: "noetic"
- image_name: "rafa606/moveit-gsplines-vim-dev:noetic"
base_image: "rafa606/moveit-vim:noetic"
ros_distro: "noetic"
steps:
- name: checkout code
uses: actions/checkout@main
with:
fetch-depth: 2
submodules: recursive
- name: Check last modified time of Foo Dockerfile
id: image_modify_date
run: |
echo "image=$(date -d "$(curl -s https://hub.docker.com/v2/repositories/"$(echo ${{ matrix.docker_image.image_name }} | sed 's/:/\/tags\//')" | jq -r '.last_updated')" +%s)" >> $GITHUB_OUTPUT;
echo "base_image=$(date -d "$(curl -s https://hub.docker.com/v2/repositories/"$(echo ${{ matrix.docker_image.base_image }} | sed 's/:/\/tags\//')" | jq -r '.last_updated')" +%s)" >> $GITHUB_OUTPUT;
- name: Check last modified time of Foo Docker image
id: file_modify_date
run: |
echo "docker_file=$(date -d "$(git log -1 --format=%cd --date=iso -- ./docker/docker.dockerfile)" +%s)" >> $GITHUB_OUTPUT
echo "source=$(date -d "$(git log -1 --format=%cd --date=iso -- ./source)" +%s)" >> $GITHUB_OUTPUT
echo "include=$(date -d "$(git log -1 --format=%cd --date=iso -- ./include)" +%s)" >> $GITHUB_OUTPUT
echo "python=$(date -d "$(git log -1 --format=%cd --date=iso -- ./python)" +%s)" >> $GITHUB_OUTPUT
echo "bindings=$(date -d "$(git log -1 --format=%cd --date=iso -- ./bindings)" +%s)" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: build and push ${{ matrix.docker_image.image_name }}
uses: docker/build-push-action@v3
with:
tags: ${{ matrix.docker_image.image_name }}
file: docker/docker.dockerfile
push: true
build-args: |
BASEIMAGE=${{ matrix.docker_image.base_image }}
ROS_DISTRO=${{ matrix.docker_image.ros_distro }}
if: |
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.docker_file ||
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.source ||
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.include ||
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.python ||
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.bindings ||
steps.image_modify_date.outputs.image < steps.image_modify_date.outputs.base_image
buildpackage:
name: build dep package
runs-on: ubuntu-latest
container:
image: ros:noetic-ros-core-focal
steps:
- name: Git Sumbodule Update ad build
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" git ros-noetic-ifopt libgtest-dev cmake build-essential libeigen3-dev
git clone --recursive https://github.com/rafaelrojasmiliani/gsplines_cpp.git
cd gsplines_cpp
mkdir build
cd build
bash -c "source /opt/ros/noetic/setup.bash && cmake .. -DBUILD_TESTING=OFF && make -j2 && cpack -G DEB"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsplines_cpp/build/gsplines-0.0.1-amd64.deb
asset_name: gsplines-0.0.1-amd64.deb
tag: ${{ github.ref }}
overwrite: true
body: "Debian pack compiled with standard ros noetic docker image"
buildpackage2:
name: build dep package with g++-11
runs-on: ubuntu-latest
container:
image: ros:noetic-ros-core-focal
steps:
- name: Git Sumbodule Update ad build
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" git ros-noetic-ifopt libgtest-dev cmake build-essential libeigen3-dev gcc-11 g++-11
bash -c 'update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9 &&
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11'
git clone --recursive https://github.com/rafaelrojasmiliani/gsplines_cpp.git
cd gsplines_cpp
mkdir build
cd build
bash -c "source /opt/ros/noetic/setup.bash && cmake .. -DBUILD_TESTING=OFF && make -j2 && cpack -G DEB"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsplines_cpp/build/gsplines-0.0.1-amd64.deb
asset_name: gsplines-0.0.1-gcc-11-amd64.deb
tag: ${{ github.ref }}
overwrite: true
body: "Debian pack compiled with g++-11"