Skip to content

Commit f33c195

Browse files
Build with composite action
1 parent fda357e commit f33c195

File tree

2 files changed

+73
-98
lines changed

2 files changed

+73
-98
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: 'Build Companion'
2+
inputs:
3+
os:
4+
description: 'OS / Architecture'
5+
required: true
6+
qt-version:
7+
description: 'Qt version'
8+
default: '6.9.0'
9+
qt-arch:
10+
description: 'Qt architecture'
11+
required: runner.os != 'Linux'
12+
sdl2-version:
13+
description: 'SDL2 version'
14+
default: '2.32.8'
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
20+
- name: Check out the repo
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
- name: Install Qt
26+
if: runner.os != 'Linux'
27+
uses: jdpurcell/install-qt-action@v5
28+
env:
29+
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
30+
with:
31+
version: ${{ inputs.qt-version }}
32+
modules: 'qtmultimedia qtserialport'
33+
arch: ${{ inputs.qt-arch }}
34+
cache: true
35+
cache-key-prefix: 'install-qt-action-${{ inputs.qt-arch }}'
36+
37+
- name: Setup SDL2
38+
if: runner.os != 'Linux'
39+
id: setup-sdl2
40+
uses: libsdl-org/setup-sdl@v1
41+
with:
42+
version: ${{ env.SDL_VERSION }}
43+
build-type: "Release"
44+
45+
- name: Setup MSVC
46+
if: runner.os == 'Windows'
47+
uses: ilammy/msvc-dev-cmd@v1
48+
49+
- name: Build
50+
env:
51+
CMAKE_BUILD_TYPE: 'Release'
52+
run: |
53+
mkdir output && \
54+
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
55+
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
56+
57+
- name: Compose release filename
58+
run: echo "artifact_name=edgetx-cpn-${{ inputs.os }}-${GITHUB_REF##*/}" >> $GITHUB_ENV
59+
60+
- name: Archive production artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: "${{ env.artifact_name }}"
64+
path: ${{github.workspace}}/output
65+
retention-days: 15

.github/workflows/companion.yml

Lines changed: 8 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ on:
2121

2222
workflow_dispatch:
2323

24-
env:
25-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
26-
CMAKE_BUILD_TYPE: Release
27-
QT_VERSION: '6.9.0'
28-
SDL_VERSION: '2.32.8'
29-
3024
jobs:
3125
build-linux:
3226
name: Linux Companion
@@ -43,22 +37,9 @@ jobs:
4337
with:
4438
submodules: recursive
4539

46-
- name: Build
47-
working-directory: ${{github.workspace}}
48-
shell: bash
49-
run: |
50-
mkdir output && \
51-
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
52-
53-
- name: Compose release filename
54-
run: echo "artifact_name=edgetx-cpn-linux-${GITHUB_REF##*/}" >> $GITHUB_ENV
55-
56-
- name: Archive production artifacts
57-
uses: actions/upload-artifact@v4
40+
- uses: ./.github/actions/build_companion
5841
with:
59-
name: "${{ env.artifact_name }}"
60-
path: ${{github.workspace}}/output
61-
retention-days: 15
42+
os: 'linux'
6243

6344
build-macos:
6445
name: macOS Companion
@@ -67,58 +48,24 @@ jobs:
6748
env:
6849
CMAKE_OSX_ARCHITECTURES: 'x86_64'
6950
CMAKE_OSX_DEPLOYMENT_TARGET: '10.15'
70-
QT_ARCH: 'clang_64'
7151

7252
steps:
7353
- name: Check out the repo
7454
uses: actions/checkout@v4
7555
with:
7656
submodules: recursive
7757

78-
- name: Install Qt
79-
uses: jdpurcell/install-qt-action@v5
80-
env:
81-
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
82-
with:
83-
version: ${{ env.QT_VERSION }}
84-
modules: 'qtmultimedia qtserialport'
85-
arch: ${{ env.QT_ARCH }}
86-
cache: true
87-
cache-key-prefix: 'install-qt-action-${{ env.QT_ARCH }}'
88-
89-
- name: Setup SDL2
90-
id: setup-sdl2
91-
uses: libsdl-org/setup-sdl@v1
58+
- uses: ./.github/actions/build_companion
9259
with:
93-
version: ${{ env.SDL_VERSION }}
94-
build-type: "Release"
95-
96-
- name: Install Python Dependencies
97-
run: python3 -m pip install clang jinja2 lz4 pillow pydantic
98-
99-
- name: Build
100-
run: |
101-
mkdir output && \
102-
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
103-
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
104-
105-
- name: Compose release filename
106-
run: echo "artifact_name=edgetx-cpn-osx-${GITHUB_REF##*/}" >> $GITHUB_ENV
107-
108-
- name: Archive production artifacts
109-
uses: actions/upload-artifact@v4
110-
with:
111-
name: "${{ env.artifact_name }}"
112-
path: ${{github.workspace}}/output
113-
retention-days: 15
60+
os: 'macos'
61+
qt-arch: 'clang_64'
11462

11563
build-win64:
11664
name: Windows Companion
11765
runs-on: windows-2022
11866

11967
env:
12068
CMAKE_GENERATOR: 'Ninja'
121-
QT_ARCH: 'win64_msvc2022_64'
12269
CXX: 'clang++'
12370
CC: 'clang'
12471

@@ -132,44 +79,7 @@ jobs:
13279
with:
13380
submodules: recursive
13481

135-
- name: Install Qt
136-
uses: jdpurcell/install-qt-action@v5
137-
env:
138-
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
139-
with:
140-
version: ${{ env.QT_VERSION }}
141-
modules: 'qtmultimedia qtserialport'
142-
arch: ${{ env.QT_ARCH }}
143-
cache: true
144-
cache-key-prefix: 'install-qt-action-${{ env.QT_ARCH }}'
145-
146-
- name: Setup SDL2
147-
id: setup-sdl2
148-
uses: libsdl-org/setup-sdl@v1
149-
with:
150-
version: ${{ env.SDL_VERSION }}
151-
build-type: "Release"
152-
153-
- name: Install Python Dependencies
154-
run: |
155-
echo $PATH
156-
$Python3_ROOT_DIR/python3.exe -m pip install clang jinja2 lz4 pillow pydantic
157-
158-
- name: Setup MSVC
159-
uses: ilammy/msvc-dev-cmd@v1
160-
161-
- name: Build
162-
run: |
163-
mkdir output && \
164-
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
165-
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
166-
167-
- name: Compose release filename
168-
run: echo "artifact_name=edgetx-cpn-win64-${GITHUB_REF##*/}" >> $GITHUB_ENV
169-
170-
- name: Archive production artifacts
171-
uses: actions/upload-artifact@v4
82+
- uses: ./.github/actions/build_companion
17283
with:
173-
name: "${{ env.artifact_name }}"
174-
path: ${{github.workspace}}/output
175-
retention-days: 15
84+
os: 'win64'
85+
qt-arch: 'win64_msvc2022_64'

0 commit comments

Comments
 (0)