forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 13
125 lines (112 loc) · 3.87 KB
/
tiiuae-sitl.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
122
123
124
125
name: tii-px4-sitl
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
packages: write
jobs:
tii-px4-sitl:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout px4-firmware
uses: actions/checkout@v3
with:
path: px4-firmware
fetch-depth: 0
- uses: docker/setup-buildx-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
# Run docker build
- name: Run fog-sw docker build
run: |
set -eux
mkdir bin
cd px4-firmware
./clone_public.sh
./build_sitl.sh ../bin/
ls ../bin/
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/tiiuae/tii-px4-sitl
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
type=raw,value=latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build tii-px4-sitl image and push
uses: docker/build-push-action@v3
with:
context: .
file: ./px4-firmware/packaging/Dockerfile.sitl
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: jfrog/setup-jfrog-cli@v3
if: github.event_name == 'push'
env:
JF_ENV_1: ${{ secrets.ARTIFACTORY_CLOUD_TOKEN }}
- name: Upload to Artifactory (px4-sitl)
env:
ARTIFACTORY_GEN_REPO: ssrc-gen-public-local
BUILD_NAME: px4-sitl
CI: true
if: github.event_name == 'push'
run: |
set -exu
jfrog rt ping
pkg=$(find bin -name 'px4_sitl_build*.tar.gz')
pkg_name=$(basename $pkg)
jfrog rt u --target-props COMMIT="$GITHUB_SHA" \
--build-name "$BUILD_NAME" \
--build-number "$GITHUB_SHA" \
"$pkg" \
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/sitl/$pkg_name"
jfrog rt build-publish "$BUILD_NAME" "$GITHUB_SHA"
jfrog rt bpr "$BUILD_NAME" "$GITHUB_SHA" "$ARTIFACTORY_GEN_REPO" \
--status dev \
--comment "development build"
jfrog rt cp --flat \
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/sitl/$pkg_name" \
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/sitl/latest/px4_sitl_build.tar.gz"
- name: Upload to Artifactory (px4-gazebo-data)
env:
ARTIFACTORY_GEN_REPO: ssrc-gen-public-local
BUILD_NAME: gazebo-data
CI: true
if: github.event_name == 'push'
run: |
set -exu
jfrog rt ping
pkg=$(find bin -name 'px4_gazebo_data*.tar.gz')
pkg_name=$(basename $pkg)
jfrog rt u --target-props COMMIT="$GITHUB_SHA" \
--build-name "$BUILD_NAME" \
--build-number "$GITHUB_SHA" \
"$pkg" \
"$ARTIFACTORY_GEN_REPO/builds/gazebo-data/$pkg_name"
jfrog rt build-publish "$BUILD_NAME" "$GITHUB_SHA"
jfrog rt bpr "$BUILD_NAME" "$GITHUB_SHA" "$ARTIFACTORY_GEN_REPO" \
--status dev \
--comment "development build"
jfrog rt cp --flat \
"$ARTIFACTORY_GEN_REPO/builds/gazebo-data/$pkg_name" \
"$ARTIFACTORY_GEN_REPO/builds/gazebo-data/latest/px4_gazebo_data.tar.gz"