@@ -3,14 +3,13 @@ name: Build
33on :
44 push :
55 branches :
6- - master
6+ - rewrite
77 pull_request :
88 branches :
9- - master
9+ - rewrite
1010 workflow_dispatch :
1111
12- env :
13- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
12+ env :
1413 BUILD_TYPE : RelWithDebInfo
1514
1615jobs :
@@ -21,24 +20,31 @@ jobs:
2120 include :
2221 - os : ubuntu-24.04
2322 arch : x64
24- binary_path : build/SonyHeadphonesClient
23+ binary_path : build/client/ SonyHeadphonesClient
2524 artifact_name : " SonyHeadphonesClient-linux-x64"
26- script : " sudo apt-get update && sudo apt-get install libbluetooth-dev libdbus-1-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev"
25+ script : " sudo apt-get update && sudo apt-get install -y libbluetooth-dev libdbus-1-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev llvm-18-dev libclang-18-dev libcurl4-openssl -dev"
2726 gcc : 14
27+ # ARM Linux runners currently has availablity issues.
28+ # TODO: Enable these once these are fixed.
29+ # https://github.com/actions/partner-runner-images/issues/132
30+ # https://github.com/actions/partner-runner-images/issues/65
31+ # - os: ubuntu-24.04-arm64
32+ # arch: arm64
33+ # binary_path: build/client/SonyHeadphonesClient
34+ # artifact_name: "SonyHeadphonesClient-linux-arm64"
35+ # script: "sudo apt-get update && sudo apt-get install -y libbluetooth-dev libdbus-1-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev llvm-18-dev libclang-18-dev libcurl4-openssl-dev"
36+ # gcc: 14
2837 - os : windows-latest
2938 arch : x64
30- binary_path : build/RelWithDebInfo/SonyHeadphonesClient.exe
39+ binary_path : build/client/ RelWithDebInfo/SonyHeadphonesClient.exe
3140 artifact_name : " SonyHeadphonesClient-win-x64"
3241 script : " "
3342 - os : windows-latest
34- arch : ARM64
35- binary_path : build/RelWithDebInfo/SonyHeadphonesClient.exe
43+ arch : arm64
44+ binary_path : build/client/ RelWithDebInfo/SonyHeadphonesClient.exe
3645 artifact_name : " SonyHeadphonesClient-win-arm64"
3746 script : " "
38- - os : macos-latest
39- arch : universal
40- binary_path : build/SonyHeadphonesClient.zip
41- artifact_name : " SonyHeadphonesClient-macOS"
47+
4248 runs-on : ${{ matrix.os }}
4349
4450 steps :
@@ -54,128 +60,35 @@ jobs:
5460 # We'll use this as our working directory for all subsequent commands
5561 run : cmake -E make_directory ${{github.workspace}}/build
5662
57- - name : Configure CMake
58- # Use a bash shell so we can use the same syntax for environment variable
59- # access regardless of the host operating system
60- shell : bash
61- working-directory : ${{github.workspace}}/build
62- # Note the current convention is to use the -S and -B options here to specify source
63- # and build directories, but this is only available with CMake 3.13 and higher.
64- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
65- run : |
66- if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
67- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -A ${{ matrix.arch }}
68- else
69- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
70- fi
71-
72- - name : Configure CMake (macOS)
73- if : runner.os == 'macOS'
74- # Use a bash shell so we can use the same syntax for environment variable
75- # access regardless of the host operating system
76- shell : bash
77- working-directory : ${{github.workspace}}/build
78- # Note the current convention is to use the -S and -B options here to specify source
79- # and build directories, but this is only available with CMake 3.13 and higher.
80- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
81- run : cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
82-
63+ - name : Configure CMake (Windows)
64+ working-directory : ${{github.workspace}}/build
65+ if : runner.os == 'Windows'
66+ run : cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -A ${{ matrix.arch }}
67+
68+ - name : Configure CMake (Linux)
69+ env :
70+ CC : gcc-${{ matrix.gcc }}
71+ CXX : g++-${{ matrix.gcc }}
72+ working-directory : ${{github.workspace}}/build
73+ if : runner.os == 'Linux'
74+ run : cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
75+
8376 - name : Build
8477 working-directory : ${{github.workspace}}/build
8578 shell : bash
8679 # Execute the build. You can specify a specific target with "--target <NAME>"
87- run : cmake --build . --config $BUILD_TYPE
88-
89- - name : Zip the App Bundle (macOS)
90- if : runner.os == 'macOS'
91- working-directory : ${{github.workspace}}/build
92- # Zip the application for easier downloading
93- run : zip -r SonyHeadphonesClient.zip SonyHeadphonesClient.app
80+ run : cmake --build . --config $BUILD_TYPE --target SonyHeadphonesClient
9481
9582 - name : Strip Symbols (Linux)
9683 if : runner.os == 'Linux'
97- working-directory : ${{github.workspace}}/build
84+ working-directory : ${{github.workspace}}
9885 # Strip symbols from the binary to reduce size
99- run : strip --strip-unneeded SonyHeadphonesClient
86+ run : strip --strip-unneeded ${{matrix.binary_path}}
10087
10188 - name : Upload a Build Artifact
10289 uses : actions/upload-artifact@v4
10390 with :
10491 # Artifact name
10592 name : ${{ matrix.artifact_name }}
10693 # A file, directory or wildcard pattern that describes what to upload
107- path : ${{github.workspace}}/${{matrix.binary_path}}
108- # The desired behavior if no files are found using the provided path.
109-
110- release :
111- name : Release
112- if : " contains(github.event.head_commit.message, 'Version')"
113- needs : ["build"]
114- runs-on : ubuntu-latest
115-
116- steps :
117- - name : Get Version
118- id : get_version
119- run : |
120- version=$(echo "${{ github.event.head_commit.message }}" | awk 'NR==1' | awk '{print $2}')
121- echo "::set-output name=version::$version"
122-
123- - uses : actions/checkout@v3
124-
125- - name : Create Release
126- id : create_release
127- uses : actions/create-release@v1
128- env :
129- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
130- with :
131- tag_name : ${{ steps.get_version.outputs.version }}
132- release_name : Version ${{ steps.get_version.outputs.version }}
133-
134- - uses : actions/download-artifact@v4
135- with :
136- path : ${{github.workspace}}/artifacts
137-
138- - name : Display structure of downloaded files
139- run : ls -R ${{github.workspace}}/artifacts
140-
141- - uses : actions/upload-release-asset@v1.0.1
142- env :
143- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
144- with :
145- upload_url : ${{ steps.create_release.outputs.upload_url }}
146- asset_path : ${{github.workspace}}/artifacts/SonyHeadphonesClient-linux-x64/SonyHeadphonesClient
147- asset_name : SonyHeadphonesClient-linux-x64
148- asset_content_type : application/octet-stream
149-
150- - uses : actions/upload-release-asset@v1.0.1
151- env :
152- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153- with :
154- upload_url : ${{ steps.create_release.outputs.upload_url }}
155- asset_path : ${{github.workspace}}/artifacts/SonyHeadphonesClient-win-x64/SonyHeadphonesClient.exe
156- asset_name : SonyHeadphonesClient-win-x64.exe
157- asset_content_type : application/vnd.microsoft.portable-executable
158-
159- - uses : actions/upload-release-asset@v1.0.1
160- env :
161- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
162- with :
163- upload_url : ${{ steps.create_release.outputs.upload_url }}
164- asset_path : ${{github.workspace}}/artifacts/SonyHeadphonesClient-win-arm64/SonyHeadphonesClient.exe
165- asset_name : SonyHeadphonesClient-win-arm64.exe
166- asset_content_type : application/vnd.microsoft.portable-executable
167-
168- - uses : actions/upload-release-asset@v1.0.1
169- env :
170- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
171- with :
172- upload_url : ${{ steps.create_release.outputs.upload_url }}
173- asset_path : ${{github.workspace}}/artifacts/SonyHeadphonesClient-macOS/SonyHeadphonesClient.zip
174- asset_name : SonyHeadphonesClient-macOS.zip
175- asset_content_type : application/zip
176-
177- - uses : eregon/publish-release@v1
178- env :
179- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
180- with :
181- release_id : ${{ steps.create_release.outputs.id }}
94+ path : ${{github.workspace}}/${{matrix.binary_path}}
0 commit comments