Skip to content

Build Release

Build Release #21

Workflow file for this run

name: Build Release
on:
release:
types: [created]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential cmake
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install cmake
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: choco install cmake nsis
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=build/install
- name: Build project
run: cmake --build build --config Release
- name: Package release with CPack
run: |
cd build
cpack
- name: Debug List build directory contents
run: ls -R build
- name: Debug List build/_CPack_Packages directory contents
run: ls -R build/_CPack_Packages
- name: Find and upload release artifacts
run: |
# Dynamically find the generated files
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
echo "Linux detected"
FILE=$(find build -name "cnh-linux-*.deb")
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
echo "macOS detected"
FILE=$(find build -name "cnh-macos-*.dmg")
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
echo "Windows detected"
FILE=$(find build -name "cnh-windows-*.exe")
fi
# Verify file exists before uploading
if [ -f "$FILE" ]; then
echo "File found: $FILE"
else
echo "File not found: $FILE"
exit 1
- name: Upload release artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifact
path: $FILE