-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (121 loc) · 4.29 KB
/
deploy_rovecomm.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Build and Create RoveComm Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
pull-requests: read
packages: read
id-token: write
concurrency:
group: "create-release"
cancel-in-progress: false
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Copy Repository to /opt
shell: bash
run: |
mkdir -p /opt/RoveComm_CPP
cp -r . /opt/RoveComm_CPP
- name: Fix Dubious Ownership
run: git config --global --add safe.directory /opt/RoveComm_CPP
- name: Checkout Tag
run: |
cd /opt/RoveComm_CPP/
git fetch --tags --force --recurse-submodules
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo $tag
git checkout $tag
git submodule update --recursive --init
- name: Install Project Dependencies
run: |
sudo apt update && sudo apt install -y libeigen3-dev zip mingw-w64
wget -q https://github.com/MissouriMRDT/Autonomy_Packages/raw/main/gtest/amd64/gtest_${GTEST_VERSION}_amd64.deb
sudo dpkg -i gtest_${GTEST_VERSION}_amd64.deb
rm gtest_${GTEST_VERSION}_amd64.deb
env:
GTEST_VERSION: "1.15.2"
- name: Build and Create Unix Executable
run: |
cd /opt/RoveComm_CPP/
if [ -d "build" ]; then rm -Rf build; fi
mkdir build
cd build
cmake ..
make
make package
- name: Rename Executable and Create ZIP
run: |
mv /opt/RoveComm_CPP/build/RoveComm_CPP**.sh /opt/RoveComm_CPP/RoveComm_CPP_AMD64_Installer.sh
tar xzf /opt/RoveComm_CPP/build/RoveComm_CPP**.tar.gz -C /opt/RoveComm_CPP/build/
mkdir -p /opt/RoveComm_CPP/build/RoveComm_CPP
mv /opt/RoveComm_CPP/build/RoveComm_CPP**/* /opt/RoveComm_CPP/build/RoveComm_CPP/
cd /opt/RoveComm_CPP/build/RoveComm_CPP/
zip -r RoveComm_CPP_AMD64.zip include/* external/* lib/*
cp RoveComm_CPP_AMD64.zip /opt/RoveComm_CPP/
- name: Build and Create Windows Executable
run: |
cd /opt/RoveComm_CPP/
if [ -d "build" ]; then rm -Rf build; fi
mkdir build
cd build
cmake -DBUILD_WIN=ON ..
make
make package
- name: Rename Executable and Create ZIP
run: |
tar xzf /opt/RoveComm_CPP/build/RoveComm_CPP**.tar.gz -C /opt/RoveComm_CPP/build/
mkdir -p /opt/RoveComm_CPP/build/RoveComm_CPP
mv /opt/RoveComm_CPP/build/RoveComm_CPP**/* /opt/RoveComm_CPP/build/RoveComm_CPP/
cd /opt/RoveComm_CPP/build/RoveComm_CPP/
zip -r RoveComm_CPP_WIN64.zip include/* external/* lib/*
cp RoveComm_CPP_WIN64.zip /opt/RoveComm_CPP/
ls /opt/RoveComm_CPP/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RoveComm-Packages
path: |
/opt/RoveComm_CPP/RoveComm_CPP_AMD64_Installer.sh
/opt/RoveComm_CPP/RoveComm_CPP_AMD64.zip
/opt/RoveComm_CPP/RoveComm_CPP_WIN64.zip
create-release:
runs-on: ubuntu-latest
needs: build-and-upload
steps:
- uses: actions/checkout@v4
- name: Checkout repository to /opt
shell: bash
run: cp -r . /opt/
- name: Fix Dubious Ownership
run: git config --global --add safe.directory /opt/RoveComm_CPP
- name: Determine Version
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create Directory
run: mkdir -p /opt/RoveComm_CPP/artifacts/
- name: Download Artifacts
uses: actions/download-artifact@v4
id: download
with:
path: /opt/RoveComm_CPP/artifacts/
- name: Display Structure
run: ls
working-directory: /opt/RoveComm_CPP/artifacts/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: true
name: "${{ steps.version.outputs.version }}"
files: "/opt/RoveComm_CPP/artifacts/**"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}