Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI workflow to publish a continuous release #380

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/continuos-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Continuos build workflow

on:
workflow_dispatch:
inputs: {}
push:
branches: [master]
paths:
- "cmake_modules/**"
- "src/**"
- "CMakeLists.txt"

jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
os_name: windows
architecture: x86_64
shell: msys2 {0}
msystem: MINGW64
install: base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-hidapi make zip
- os: ubuntu-latest
os_name: linux
architecture: x86_64
shell: bash
install: sudo apt-get -y install libhidapi-dev
- os: macos-latest
os_name: macos
architecture: x86_64
shell: bash
install: brew install hidapi
steps:
- uses: actions/checkout@v4

- name: Setup environment
if: matrix.os_name == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: ${{ matrix.install }}

- name: Install dependencies
if: matrix.os_name != 'windows'
run: ${{ matrix.install }}

- name: Build
if: matrix.os_name == 'windows'
run: |
mkdir build
cd build
cmake -G"MSYS Makefiles" ..
make

- name: Run CMake with Ninja
if: matrix.os_name != 'windows'
uses: lukka/run-cmake@v3
id: runcmake
with:
cmakeListsTxtPath: "${{ github.workspace }}/CMakeLists.txt"
buildWithCMakeArgs: "-- -v"
buildDirectory: ${{ github.workspace }}/build

- name: Zip build artifacts
run: |
cd build
zip -r headsetcontrol-${{ matrix.os_name }}-${{ matrix.architecture }}.zip headsetcontrol

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: headsetcontrol-${{ matrix.os_name }}-${{ matrix.architecture }}
path: build/headsetcontrol-${{ matrix.os_name }}-${{ matrix.architecture }}.zip

create-release:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Windows Artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Deploy continuous
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "continuous"
prerelease: true
title: 'Continuous Build'
files: |
headsetcontrol-*
Loading