Skip to content

Throne build matrix #652

Throne build matrix

Throne build matrix #652

Workflow file for this run

name: Throne build matrix
on:
workflow_dispatch:
inputs:
tag:
description: "Release Tag and version"
required: true
publish:
description: "r for normal release, p for prerelease, leave empty to not publish anything"
required: false
jobs:
build-go:
permissions:
contents: read
strategy:
matrix:
include:
- cross_os: windows
cross_arch: amd64
go_version: "1.25.9"
- cross_os: windows
cross_arch: arm64
go_version: "1.25.9"
- cross_os: linux
cross_arch: amd64
go_version: "1.25.9"
- cross_os: linux
cross_arch: arm64
go_version: "1.25.9"
- cross_os: darwin
cross_arch: amd64
go_version: "1.25.9"
- cross_os: darwin
cross_arch: arm64
go_version: "1.25.9"
- cross_os: darwinlegacy
cross_arch: amd64
go_version: "1.25.9"
- cross_os: windowslegacy
cross_arch: amd64
go_version: "1.25.9"
- cross_os: windowslegacy
cross_arch: 386
go_version: "1.25.9"
fail-fast: false
runs-on: macos-latest
env:
DEST: ${{ github.workspace }}/deployment/${{ matrix.cross_os }}-${{ matrix.cross_arch }}
steps:
- name: Checking out sources
uses: actions/checkout@v4.2.2
- name: Cache Common Download
id: cache-common
uses: actions/cache@v4.2.3
with:
path: artifacts.tgz
key: CommonCache-${{ matrix.cross_os }}-${{ matrix.cross_arch }}-${{ hashFiles('script/build_go.sh', 'core/*') }}-${{ matrix.go_version }}
- name: Install Golang
if: steps.cache-common.outputs.cache-hit != 'true'
uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go_version }}
cache-dependency-path: |
core/server/go.sum
- name: Install Golang For Legacy OS
if: steps.cache-common.outputs.cache-hit != 'true' && contains( matrix.cross_os, 'legacy' )
run: |
curl -L -o go.zip https://github.com/throneproj/env_windows_legacy/releases/download/latest/go.zip
7z x go.zip
- name: Install Protoc
if: steps.cache-common.outputs.cache-hit != 'true'
uses: arduino/setup-protoc@v3
with:
version: "31.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Installing protoc-gen-go
if: steps.cache-common.outputs.cache-hit != 'true'
run: |
go install github.com/golang/protobuf/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Build golang parts
if: steps.cache-common.outputs.cache-hit != 'true'
shell: bash
run: |
GOOS=${{ matrix.cross_os }} GOARCH=${{ matrix.cross_arch }} ./script/build_go.sh
- name: Tar files
if: steps.cache-common.outputs.cache-hit != 'true'
run: tar czvf artifacts.tgz ./deployment
- name: Uploading Artifact
uses: actions/upload-artifact@v4.6.2
with:
name: Throne-${{ github.sha }}-Common-${{ matrix.cross_os }}-${{ matrix.cross_arch }}
path: artifacts.tgz
build-cpp:
permissions:
contents: read
needs:
- build-go
strategy:
matrix:
include:
- platform: windows-latest
qt_version: "6.11.0"
target: x64
dest_suffix: windows-amd64
- platform: windows-11-arm
qt_version: "6.11.0"
target: arm64
dest_suffix: windows-arm64
- platform: ubuntu-22.04
qt_version: "6.11.0"
target: x86_64
dest_suffix: linux-amd64
- platform: ubuntu-22.04
qt_version: "6.2.0"
target: x86_64
dest_suffix: linux-amd64-system-qt
- platform: ubuntu-24.04-arm
qt_version: "6.11.0"
target: aarch64
dest_suffix: linux-arm64
- platform: ubuntu-22.04-arm
qt_version: "6.2.0"
target: aarch64
dest_suffix: linux-arm64-system-qt
- platform: macos-latest
qt_version: "6.11.0"
target: x86_64
dest_suffix: darwin-amd64
- platform: macos-latest
qt_version: "6.11.0"
target: arm64
dest_suffix: darwin-arm64
- platform: macos-latest
qt_version: "6.4.3"
target: x86_64
dest_suffix: darwinlegacy-amd64
- platform: windows-latest
qt_version: "6.2.13"
target: x64
dest_suffix: windowslegacy-amd64
- platform: windows-latest
qt_version: "6.2.13"
target: x86
dest_suffix: windowslegacy-386
fail-fast: false
runs-on: ${{ matrix.platform }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
INPUT_VERSION: ${{ github.event.inputs.tag }}
DEST: ${{ github.workspace }}/deployment/${{ matrix.dest_suffix }}
DEST_SUFFIX: ${{ matrix.dest_suffix }}
ARCH: ${{ matrix.target }}
steps:
- name: Checking out sources
uses: actions/checkout@v4.2.2
with:
submodules: "recursive"
- name: Install MSVC compiler
if: contains( matrix.platform, 'windows' )
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.target }}
- name: Download Artifacts
uses: actions/download-artifact@v4.3.0
with:
path: download-artifact
# ========================================================================================================= Qt Install
- name: Install Qt
uses: jurplel/install-qt-action@v4.3.0
if: (!contains(matrix.platform, 'windows')) && matrix.qt_version != '6.2.0'
with:
version: ${{ matrix.qt_version }}
setup-python: true
cache: true
cache-key-prefix: QtCache-${{ matrix.dest_suffix }}
# ========================================================================================================= Generate MakeFile and Build
- name: Windows - Generate MakeFile and Build
shell: bash
if: contains( matrix.platform, 'windows' )
run: |
curl -L -o qt.7z https://github.com/throneproj/buildqt/releases/download/Qt_${{ matrix.qt_version }}/Qt_${{ matrix.qt_version }}_${{ matrix.target }}.7z
7z x qt.7z
curl -L -o openssl.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/openssl_${{ matrix.target }}.7z
7z x openssl.7z
export CMAKE_PREFIX_PATH=$PWD/Qt/lib/cmake
export OPENSSL_ROOT_DIR=$PWD/openssl
mkdir build
cd build
curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h"
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
ninja
cd ..
./script/deploy_windows.sh
- name: Build Installer with NSIS
shell: cmd
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.13'
run: |
choco install nsis
cp .\script\windows_installer.nsi .
"C:\Program Files (x86)\NSIS\makensis.exe" windows_installer.nsi
cp ThroneSetup.exe deployment/
- name: Linux - Generate MakeFile and Build
shell: bash
if: contains( matrix.platform, 'ubuntu' ) && matrix.qt_version != '6.2.0'
run: |
sudo apt update && sudo apt upgrade -y
mkdir build
cd build
curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h"
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" ..
ninja
cd ..
./script/deploy_linux64.sh
- name: Linux Using System Qt - Generate MakeFile and Build
shell: bash
if: contains( matrix.platform, 'ubuntu' ) && matrix.qt_version == '6.2.0'
run: |
sudo apt update && sudo apt upgrade -y
sudo apt install qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6svg6-dev qt6-translations-l10n libglx-dev libgl1-mesa-dev
mkdir build
cd build
curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h"
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc" ..
ninja
cd ..
./script/deploy_linux64_system_qt.sh
- name: macOS - Generate MakeFile and Build
shell: bash
if: matrix.platform == 'macos-latest'
run: |
mkdir build
cd build
curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h"
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNKR_PACKAGE_MACOS=1 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=${{ matrix.target }} ..
ninja
cd ..
./script/deploy_macos.sh
# ========================================================================================================= Deployments
- name: Tar files
shell: bash
run: tar czvf artifacts.tgz ./deployment
- name: Uploading Artifact
uses: actions/upload-artifact@v4.6.2
with:
name: Throne-${{ github.sha }}-${{ matrix.dest_suffix }}
path: artifacts.tgz
publish:
name: Pack & Publish Release
runs-on: ubuntu-latest
needs:
- build-cpp
permissions:
contents: write
actions: read
steps:
- name: Checking out sources
uses: actions/checkout@v4.2.2
- name: Download Artifacts
uses: actions/download-artifact@v4.3.0
with:
path: download-artifact
- name: Pack
run: |
curl -Lo - https://github.com/tcnksm/ghr/releases/download/v0.17.0/ghr_v0.17.0_linux_amd64.tar.gz | tar xzv
mv ghr*linux_amd64/ghr .
find . -name artifacts.tgz | xargs -n1 tar xvzf
cd deployment
mkdir debug
####
bash ../script/pack_debian.sh ${{ github.event.inputs.tag }} amd64
mv Throne.deb Throne-${{ github.event.inputs.tag }}-debian-amd64.deb
rm -rf Throne
####
bash ../script/pack_debian.sh ${{ github.event.inputs.tag }} amd64 systemqt
mv Throne.deb Throne-${{ github.event.inputs.tag }}-debian-amd64-system-qt.deb
rm -rf Throne
####
bash ../script/pack_debian.sh ${{ github.event.inputs.tag }} arm64
mv Throne.deb Throne-${{ github.event.inputs.tag }}-debian-arm64.deb
rm -rf Throne
####
bash ../script/pack_debian.sh ${{ github.event.inputs.tag }} arm64 systemqt
mv Throne.deb Throne-${{ github.event.inputs.tag }}-debian-arm64-system-qt.deb
rm -rf Throne
####
mv linux-amd64 Throne
mv Throne/Throne.debug debug/Throne-${{ github.event.inputs.tag }}-linux-amd64.debug
zip -9 -r Throne-${{ github.event.inputs.tag }}-linux-amd64.zip Throne
rm -rf Throne
####
mv linux-arm64 Throne
mv Throne/Throne.debug debug/Throne-${{ github.event.inputs.tag }}-linux-arm64.debug
zip -9 -r Throne-${{ github.event.inputs.tag }}-linux-arm64.zip Throne
rm -rf Throne
####
mv ThroneSetup.exe Throne-${{ github.event.inputs.tag }}-windows64-installer.exe
mv windows-amd64 Throne
mv Throne/Throne.pdb debug/Throne-${{ github.event.inputs.tag }}-windows-amd64.pdb
zip -9 -r Throne-${{ github.event.inputs.tag }}-windows64.zip Throne
rm -rf Throne
####
mv windows-arm64 Throne
mv Throne/Throne.pdb debug/Throne-${{ github.event.inputs.tag }}-windows-arm64.pdb
zip -9 -r Throne-${{ github.event.inputs.tag }}-windows-arm64.zip Throne
rm -rf Throne
####
mv windowslegacy-386 Throne
mv Throne/Throne.pdb debug/Throne-${{ github.event.inputs.tag }}-windowslegacy-386.pdb
zip -9 -r Throne-${{ github.event.inputs.tag }}-windows32.zip Throne
rm -rf Throne
####
mv windowslegacy-amd64 Throne
mv Throne/Throne.pdb debug/Throne-${{ github.event.inputs.tag }}-windowslegacy-amd64.pdb
zip -9 -r Throne-${{ github.event.inputs.tag }}-windowslegacy64.zip Throne
rm -rf Throne
####
mkdir Throne
mv darwin-arm64/Throne.app Throne/Throne.app
mv Throne/Throne.app/Contents/MacOS/Throne.dSYM debug/Throne-${{ github.event.inputs.tag }}-macos-arm64.dSYM
zip -9 --symlinks -r Throne-${{ github.event.inputs.tag }}-macos-arm64.zip Throne
rm -rf darwin-arm64
rm -rf Throne
####
mkdir Throne
mv darwin-amd64/Throne.app Throne/Throne.app
mv Throne/Throne.app/Contents/MacOS/Throne.dSYM debug/Throne-${{ github.event.inputs.tag }}-macos-amd64.dSYM
zip -9 --symlinks -r Throne-${{ github.event.inputs.tag }}-macos-amd64.zip Throne
rm -rf darwin-amd64
rm -rf Throne
####
mkdir Throne
mv darwinlegacy-amd64/Throne.app Throne/Throne.app
mv Throne/Throne.app/Contents/MacOS/Throne.dSYM debug/Throne-${{ github.event.inputs.tag }}-macoslegacy-amd64.dSYM
zip -9 --symlinks -r Throne-${{ github.event.inputs.tag }}-macoslegacy-amd64.zip Throne
rm -rf darwinlegacy-amd64
rm -rf Throne
####
zip -9 -r debug-symbols.zip debug
- name: Uploading Debug Artifact
uses: actions/upload-artifact@v4.6.2
with:
name: Debug-${{ github.sha }}
path: deployment/debug-symbols.zip
- name: Clean Up
run: |
cd deployment
rm -rf windows-amd64
rm -rf windows-arm64
rm -rf linux-amd64
rm -rf linux-amd64-system-qt
rm -rf linux-arm64
rm -rf linux-arm64-system-qt
rm -rf darwin-amd64
rm -rf darwin-arm64
rm -rf darwinlegacy-amd64
rm -rf windowslegacy-amd64
rm -rf windowslegacy-386
rm -rf *.pdb
rm -rf debug*
- name: Uploading Artifact
uses: actions/upload-artifact@v4.6.2
with:
name: Deployment-${{ github.sha }}
path: deployment
- name: PreRelease
if: github.event.inputs.publish == 'p'
run: |
./ghr -prerelease -delete -c ${{ github.sha }} -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" deployment
- name: Release
if: github.event.inputs.publish == 'r'
run: |
./ghr -delete -c ${{ github.sha }} -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" deployment