-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI with deployment on version tag (#53)
* Update hidapi submodule
- Loading branch information
Showing
2 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: Build | ||
|
||
on: [push] | ||
|
||
env: | ||
# Path to the solution file relative to the root of the project. | ||
SOLUTION_FILE_PATH: windows/wooting-rgb-sdk.sln | ||
|
||
# Configuration type to build. | ||
# You can convert this to a build matrix if you need coverage of multiple configuration types. | ||
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
BUILD_CONFIGURATION: Release | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: write | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest] | ||
include: | ||
- os: windows-latest | ||
target: x64 | ||
- os: windows-latest | ||
target: x86 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Add MSBuild to PATH (Windows) | ||
if: startsWith(matrix.os, 'windows') | ||
uses: microsoft/setup-msbuild@v1.1 | ||
|
||
- name: Install dependencies | ||
uses: ConorMacBride/install-package@v1 | ||
with: | ||
brew: hidapi | ||
apt: libhidapi-dev libhidapi-hidraw0 | ||
|
||
- name: Build (Linux) | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: cd linux && make | ||
|
||
- name: Build (Mac) | ||
if: startsWith(matrix.os, 'mac') | ||
run: cd mac && make | ||
|
||
# - name: Restore NuGet packages | ||
# working-directory: ${{env.GITHUB_WORKSPACE}} | ||
# run: nuget restore ${{env.SOLUTION_FILE_PATH}} | ||
|
||
- name: Build (Windows) | ||
if: startsWith(matrix.os, 'windows') | ||
working-directory: ${{env.GITHUB_WORKSPACE}} | ||
# Add additional options to the MSBuild command line here (like platform or verbosity level). | ||
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | ||
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{matrix.target}} ${{env.SOLUTION_FILE_PATH}} | ||
|
||
- name: Gen Release name | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
shell: bash | ||
run: | | ||
VER=${GITHUB_REF##*v} | ||
OS=${{matrix.os}} | ||
OS_NAME=${OS%-*} | ||
R_TARGET=${{matrix.target}} | ||
TARGET=${R_TARGET:-x64} | ||
echo "TAG_VERSION=$VER" >> $GITHUB_ENV | ||
echo "RELEASE_NAME=wooting-rgb-sdk-v$VER-$OS_NAME-$TARGET" >> $GITHUB_ENV | ||
- name: Init dist | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
shell: bash | ||
run: | | ||
mkdir dist | ||
cp src/*.h dist/ | ||
- name: Copy dist files (Linux) | ||
if: startsWith(github.ref, 'refs/tags/v') && startsWith(matrix.os, 'ubuntu') | ||
shell: bash | ||
run: | | ||
cp linux/*.pc dist/ | ||
cp linux/*.so dist/ | ||
- name: Copy dist files (Mac) | ||
if: startsWith(github.ref, 'refs/tags/v') && startsWith(matrix.os, 'mac') | ||
shell: bash | ||
run: | | ||
cp mac/*.pc dist/ | ||
cp mac/*.dylib dist/ | ||
- name: Copy dist files (Windows) | ||
if: startsWith(github.ref, 'refs/tags/v') && startsWith(matrix.os, 'windows') | ||
shell: bash | ||
run: | | ||
# Copy Windows x64 files | ||
cp windows/x64/${{env.BUILD_CONFIGURATION}}/wooting-rgb-sdk64.dll dist/ || true | ||
cp windows/x64/${{env.BUILD_CONFIGURATION}}/wooting-rgb-sdk64.lib dist/ || true | ||
cp windows/x64/${{env.BUILD_CONFIGURATION}}/wooting-rgb-sdk64.pdb dist/ || true | ||
# Copy Windows x86 files | ||
cp windows/${{env.BUILD_CONFIGURATION}}/wooting-rgb-sdk.dll dist/ || true | ||
cp windows/${{env.BUILD_CONFIGURATION}}/wooting-rgb-sdk.lib dist/ || true | ||
cp windows/${{env.BUILD_CONFIGURATION}}/wooting-rgb-sdk.pdb dist/ || true | ||
- name: Zip files | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: vimtor/action-zip@v1 | ||
with: | ||
files: dist/ | ||
recursive: true | ||
dest: ${{env.RELEASE_NAME}}.zip | ||
|
||
- name: Make Release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{env.RELEASE_NAME}}.zip | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: true |
Submodule hidapi
updated
61 files