Skip to content

Merge pull request #20 from r52/update #74

Merge pull request #20 from r52/update

Merge pull request #20 from r52/update #74

Workflow file for this run

name: Build Quasar
on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- "widgets/**"
- "**.js"
- "**.html"
- "**.css"
- "**.yml"
pull_request:
branches:
- master
paths-ignore:
- "docs/**"
- "**.md"
- "**.rst"
- "widgets/**"
- "**.js"
- "**.html"
- "**.css"
- "**.yml"
workflow_dispatch:
release:
types:
- published
jobs:
build:
strategy:
fail-fast: true
matrix:
builder: [windows-clang, ubuntu-gcc, ubuntu-clang]
include:
- builder: windows-clang
os: windows-latest
arch: "win64_msvc2019_64"
cc: clang-cl.exe
cxx: clang-cl.exe
g: '-G "Ninja Multi-Config"'
packages: ninja
- builder: ubuntu-gcc
os: ubuntu-latest
arch: "gcc_64"
cc: gcc-12
cxx: g++-12
g: "-G Ninja"
packages: ninja-build
- builder: ubuntu-clang
os: ubuntu-latest
arch: "gcc_64"
cc: clang-16
cxx: clang++-16
g: "-G Ninja"
packages: ninja-build
name: Build Quasar
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Setup Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: "==3.1.*"
version: "6.5.2"
arch: ${{ matrix.arch }}
modules: qtwebengine qtpositioning qtwebchannel qtnetworkauth qtserialport
cache: "true"
- name: Set up Packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.packages }}
- name: Set up Packages (Windows)
if: runner.os == 'Windows'
run: choco install ${{ matrix.packages }}
- name: Set up Clang
if: matrix.builder == 'ubuntu-clang' || matrix.builder == 'windows-clang'
uses: egor-tensin/setup-clang@v1
with:
version: 16
- name: Setup MSVC Environment (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Cache vcpkg
uses: lukka/run-vcpkg@v10
with:
prependedCacheKey: ${{ matrix.builder }}
vcpkgJsonGlob: "vcpkg.json"
- name: Configure Project
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S./ -B./build ${{ matrix.g }}
- name: Build Project
run: cmake --build ./build --config Release --target all --
- name: Package Quasar
if: runner.os == 'Windows'
shell: powershell
run: |
$QUASAR_VERSION = (Select-String -Path ./quasar/CMakeLists.txt -Pattern 'project\(quasar VERSION ([0-9\.]+)\)') | %{$_.Matches.Groups[1].value}
$RELEASE_PACKAGE_FILE = "quasar-windows-v$QUASAR_VERSION.zip"
7z a $RELEASE_PACKAGE_FILE ./build/quasar/Release/*
$release_filepath = Get-ChildItem $RELEASE_PACKAGE_FILE | %{$_[0].FullName}
echo "RELEASE_PACKAGE_PATH=$release_filepath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Package Sample Widgets
if: runner.os == 'Windows' && github.event_name == 'release'
shell: powershell
run: |
$WIDGETS_PACKAGE_FILE = "quasar-sample-widgets.zip"
7z a $WIDGETS_PACKAGE_FILE ./widgets/
$widgets_filepath = Get-ChildItem $WIDGETS_PACKAGE_FILE | %{$_[0].FullName}
echo "WIDGETS_PACKAGE_FILE=$widgets_filepath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload Build Artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: quasar-windows-Release
path: ${{ env.RELEASE_PACKAGE_PATH }}
if-no-files-found: error
retention-days: 1
- name: Upload Release Asset
if: runner.os == 'Windows' && github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.RELEASE_PACKAGE_PATH }}
- name: Upload Sample Widgets
if: runner.os == 'Windows' && github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.WIDGETS_PACKAGE_FILE }}