logs: reduce flood #133
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
# This is a basic workflow to help you get started with Actions | |
name: main | |
# Controls when the workflow will run | |
# Triggers the workflow on push or pull request events | |
on: [push, pull_request, workflow_dispatch] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# Linux build | |
linux: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential ninja-build cmake qttools5-dev qtbase5-dev libjack-jackd2-dev portaudio19-dev libqt5serialport5-dev | |
# Runs a set of commands using the runners shell | |
- name: Build | |
run: | | |
git submodule -q update --init --recursive | |
mkdir build | |
cmake -S . -B build -GNinja | |
cmake --build build --target package --config RelWithDebInfo | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: "damc-linux" # optional, default is artifact | |
# A file, directory or wildcard pattern that describes what to upload | |
path: build/*.tar.gz | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "build/*.tar.gz" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Windows 32 and 64 bits build | |
windows: | |
# The type of runner that the job will run on | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- arch: 32 | |
- arch: 64 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
id: dependencies | |
run: | | |
$QT_ROOT="$env:GITHUB_WORKSPACE\Qt" | |
echo "Checking latest version of Jack ..." | |
$JACK_RELEASES_URL = "https://api.github.com/repos/jackaudio/jack2/releases" | |
$jack_releases = Invoke-WebRequest $JACK_RELEASES_URL | ConvertFrom-Json | |
$jack_latest_version = $jack_releases[0].tag_name | |
if ($jack_latest_version -eq "") { | |
Write-Error "Failed to retrieve latest version" | |
exit 1 | |
} | |
echo "Downloading Jack win${{ matrix.config.arch }} $jack_latest_version ..." | |
$downloadUrl = "https://github.com/jackaudio/jack2-releases/releases/download/$jack_latest_version/jack2-win${{ matrix.config.arch }}-$jack_latest_version.exe" | |
$exePath = "$($env:TEMP)\jack2_installer.exe" | |
echo "Downloading from $downloadUrl" | |
(New-Object Net.WebClient).DownloadFile($downloadUrl, $exePath) | |
echo "Installing..." | |
cmd /c start /wait $exePath /SILENT /NORESTART /NOICONS /TYPE=full | |
echo "Done installing Jack win${{ matrix.config.arch }} $jack_latest_version" | |
echo "JACK_VERSION=$jack_latest_version" >> $env:GITHUB_OUTPUT | |
pip install -U pip | |
pip install --pre aqtinstall | |
pip show aqtinstall | |
# Latest Windows 7 and 32 bits version of qt is 5.x branch as 6.x dropped Windows 7 and 32 bits versions | |
$qt_latest_version = python3 -m aqt list-qt windows desktop --spec 5 --latest-version | |
$qt_path="$QT_ROOT\$qt_latest_version\mingw81_${{ matrix.config.arch }}" | |
$mingw_path="$QT_ROOT\Tools\mingw810_${{ matrix.config.arch }}" | |
$ninja_path="$QT_ROOT\Tools\Ninja" | |
echo "QT_ROOT=$QT_ROOT" >> $env:GITHUB_OUTPUT | |
echo "QT_VERSION=$qt_latest_version" >> $env:GITHUB_OUTPUT | |
echo "QT_PATH=$qt_path" >> $env:GITHUB_OUTPUT | |
echo "MINGW_PATH=$mingw_path" >> $env:GITHUB_OUTPUT | |
echo "NINJA_PATH=$ninja_path" >> $env:GITHUB_OUTPUT | |
- name: Cache Qt | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.dependencies.outputs.QT_ROOT }} | |
key: "3${{ runner.os }}-${{ matrix.config.arch }}-${{ steps.dependencies.outputs.QT_VERSION }}" | |
- name: Install Qt | |
run: | | |
$QT_ROOT="${{ steps.dependencies.outputs.QT_ROOT }}" | |
$qt_latest_version = "${{ steps.dependencies.outputs.QT_VERSION }}" | |
$qt_path="${{ steps.dependencies.outputs.QT_PATH }}" | |
$mingw_path="${{ steps.dependencies.outputs.MINGW_PATH }}" | |
$ninja_path="${{ steps.dependencies.outputs.NINJA_PATH }}" | |
if ( -not (Test-Path -Path $QT_ROOT)) { | |
mkdir $QT_ROOT | |
} | |
echo $QT_ROOT | |
cd $QT_ROOT | |
if ( -not (Test-Path -Path $qt_path)) { | |
echo "Installing Qt $qt_latest_version" | |
$cnt = 0 | |
do { | |
$cnt++ | |
python3 -m aqt install-qt windows desktop $qt_latest_version win${{ matrix.config.arch }}_mingw81 | |
if ($lastexitcode -ne 0 -and $cnt -ge 5) { | |
exit $lastexitcode | |
} | |
} while ($lastexitcode -ne 0) | |
} else { | |
echo "Qt $qt_latest_version already installed at $qt_path" | |
} | |
if ( -not (Test-Path -Path $mingw_path)) { | |
echo "Installing win${{ matrix.config.arch }}_mingw810" | |
$cnt = 0 | |
do { | |
$cnt++ | |
python3 -m aqt install-tool windows desktop tools_mingw qt.tools.win${{ matrix.config.arch }}_mingw810 | |
if ($lastexitcode -ne 0 -and $cnt -ge 5) { | |
exit $lastexitcode | |
} | |
} while ($lastexitcode -ne 0) | |
} else { | |
echo "win${{ matrix.config.arch }}_mingw810 already installed at $mingw_path" | |
} | |
if ( -not (Test-Path -Path $ninja_path)) { | |
echo "Installing ninja" | |
$cnt = 0 | |
do { | |
$cnt++ | |
python3 -m aqt install-tool windows desktop tools_ninja qt.tools.ninja | |
if ($lastexitcode -ne 0 -and $cnt -ge 5) { | |
exit $lastexitcode | |
} | |
} while ($lastexitcode -ne 0) | |
} else { | |
echo "ninja already installed at $ninja_path" | |
} | |
dir -Recurse -Depth 1 | |
cd $env:GITHUB_WORKSPACE | |
# Runs a set of commands using the runners shell | |
- name: Build | |
run: | | |
echo "Using MinGW at ${{ steps.dependencies.outputs.MINGW_PATH }}" | |
echo "Using Qt at ${{ steps.dependencies.outputs.QT_PATH }}" | |
$env:CC="gcc.exe" | |
$env:CXX="g++.exe" | |
$env:PATH="${{ steps.dependencies.outputs.NINJA_PATH }};${{ steps.dependencies.outputs.MINGW_PATH }}\bin;$env:PATH" | |
git submodule -q update --init --recursive | |
mkdir build | |
cmake -S . -B build "-GNinja" "-DCMAKE_PREFIX_PATH=${{ steps.dependencies.outputs.QT_PATH }}\lib\cmake" | |
if ($lastexitcode -ne 0) { exit $lastexitcode } | |
cmake --build build --target package --config RelWithDebInfo -- -j4 | |
if ($lastexitcode -ne 0) { exit $lastexitcode } | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: "damc-win${{ matrix.config.arch }}" # optional, default is artifact | |
# A file, directory or wildcard pattern that describes what to upload | |
path: build/*.zip | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "build/*.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |