Build and Create RoveComm Release #11
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 | |
- 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: | | |
ls /opt | |
cd /opt/RoveComm_CPP | |
git fetch --tags --force | |
tag=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo $tag | |
git checkout $tag | |
- name: Install Project Dependencies | |
run: | | |
sudo apt update && sudo apt install libeigen3-dev | |
wget -q https://github.com/MissouriMRDT/Autonomy_Packages/raw/main/quill/amd64/quill_${QUILL_VERSION}_amd64.deb | |
sudo dpkg -i quill_${QUILL_VERSION}_amd64.deb | |
rm quill_${QUILL_VERSION}_amd64.deb | |
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: | |
QUILL_VERSION: "3.6.0" | |
GTEST_VERSION: "1.14.0" | |
- name: Build and Create 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 | |
run: mv /opt/RoveComm_CPP/build/RoveComm_CPP**.sh /opt/RoveComm_CPP/build/RoveComm_CPP_AMD64.sh | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RoveComm-AMD64 | |
path: /opt/RoveComm_CPP/build/RoveComm_CPP_AMD64.sh | |
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: false | |
name: "${{ steps.version.outputs.version }}" | |
files: "/opt/RoveComm_CPP/artifacts/**" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |