Skip to content

Commit 689c1fc

Browse files
authored
Add CI workflow to publish a continuous release (#380)
* Add continuous CI build workflow for multi-platform support
1 parent c96c3d9 commit 689c1fc

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Continuos build workflow
2+
3+
on:
4+
workflow_dispatch:
5+
inputs: {}
6+
push:
7+
branches: [master]
8+
paths:
9+
- "cmake_modules/**"
10+
- "src/**"
11+
- "CMakeLists.txt"
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
defaults:
17+
run:
18+
shell: ${{ matrix.shell }}
19+
strategy:
20+
matrix:
21+
os: [windows-latest, ubuntu-latest, macos-latest]
22+
include:
23+
- os: windows-latest
24+
os_name: windows
25+
architecture: x86_64
26+
shell: msys2 {0}
27+
msystem: MINGW64
28+
install: base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-hidapi make zip
29+
- os: ubuntu-latest
30+
os_name: linux
31+
architecture: x86_64
32+
shell: bash
33+
install: sudo apt-get -y install libhidapi-dev
34+
- os: macos-latest
35+
os_name: macos
36+
architecture: x86_64
37+
shell: bash
38+
install: brew install hidapi
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Setup environment
43+
if: matrix.os_name == 'windows'
44+
uses: msys2/setup-msys2@v2
45+
with:
46+
msystem: ${{ matrix.msystem }}
47+
update: true
48+
install: ${{ matrix.install }}
49+
50+
- name: Install dependencies
51+
if: matrix.os_name != 'windows'
52+
run: ${{ matrix.install }}
53+
54+
- name: Build
55+
if: matrix.os_name == 'windows'
56+
run: |
57+
mkdir build
58+
cd build
59+
cmake -G"MSYS Makefiles" ..
60+
make
61+
62+
- name: Run CMake with Ninja
63+
if: matrix.os_name != 'windows'
64+
uses: lukka/run-cmake@v3
65+
id: runcmake
66+
with:
67+
cmakeListsTxtPath: "${{ github.workspace }}/CMakeLists.txt"
68+
buildWithCMakeArgs: "-- -v"
69+
buildDirectory: ${{ github.workspace }}/build
70+
71+
- name: Zip build artifacts
72+
run: |
73+
cd build
74+
zip -r headsetcontrol-${{ matrix.os_name }}-${{ matrix.architecture }}.zip headsetcontrol
75+
76+
- name: Upload build artifacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: headsetcontrol-${{ matrix.os_name }}-${{ matrix.architecture }}
80+
path: build/headsetcontrol-${{ matrix.os_name }}-${{ matrix.architecture }}.zip
81+
82+
create-release:
83+
needs: [build]
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Download Windows Artifact
88+
uses: actions/download-artifact@v4
89+
with:
90+
merge-multiple: true
91+
- name: Deploy continuous
92+
uses: crowbarmaster/GH-Automatic-Releases@latest
93+
with:
94+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
95+
automatic_release_tag: "continuous"
96+
prerelease: true
97+
title: 'Continuous Build'
98+
files: |
99+
headsetcontrol-*

0 commit comments

Comments
 (0)