Skip to content

release #6

release #6 #269

name: Build and Release
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
jobs:
build-and-release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
artifact_extension: tar.gz
shell: bash
- os: macos-latest
artifact_extension: zip
shell: bash
- os: windows-latest
artifact_extension: zip
shell: pwsh
steps:
- name: Checkout code
uses: actions/checkout@v4
# Install dependencies based on OS
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build \
qt6-base-dev qt6-tools-dev qt6-tools-dev-tools \
qt6-l10n-tools libgl1-mesa-dev libglu1-mesa-dev rsync
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install ninja qt
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install qt --version=6.5.3 -y
choco install ninja -y
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
# Configure CMake
- name: Configure CMake
run: |
cmake -B "${{ github.workspace }}/build" \
-DCMAKE_BUILD_TYPE=Release \
-G "Ninja" \
-S "${{ github.workspace }}"
shell: ${{ matrix.shell }}

Check failure on line 63 in .github/workflows/cmake-multi-platform.yml

View workflow run for this annotation

GitHub Actions / Build and Release

Invalid workflow file

The workflow is not valid. .github/workflows/cmake-multi-platform.yml (Line: 63, Col: 14): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell .github/workflows/cmake-multi-platform.yml (Line: 68, Col: 14): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shell
# Build Application
- name: Build application
run: cmake --build "${{ github.workspace }}/build" --config Release
shell: ${{ matrix.shell }}
# Package Application
- name: Package application (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
BUILD_DIR="${{ github.workspace }}/build"
TEMP_DIR="/tmp/build_copy"
rm -rf $TEMP_DIR
rsync -a "$BUILD_DIR/" "$TEMP_DIR/"
cd $TEMP_DIR
tar -czvf application.tar.gz ./*
- name: Package application (macOS)
if: matrix.os == 'macos-latest'
run: |
cd "${{ github.workspace }}/build"
hdiutil create -volname Application -srcfolder . -ov -format UDZO application.dmg
zip application.zip application.dmg
- name: Package application (Windows)
if: matrix.os == 'windows-latest'
run: |
cd "${{ github.workspace }}/build"
Compress-Archive -Path . -DestinationPath application.zip
# Upload Artifacts
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: application-${{ matrix.os }}
path: |
${{ github.workspace }}/build/application.${{ matrix.artifact_extension }}
/tmp/build_copy/application.tar.gz