Change macro defines. #56
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |