Skip to content
Draft
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
99 changes: 63 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,77 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
branches: [main]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
test:
if: false
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
cache: true
cache-dependency-path: Waratah/*/packages.lock.json

- name: Restore
run: dotnet restore Waratah\Waratah.sln --locked-mode

- name: Test
run: dotnet test Waratah\Waratah.sln

# Steps represent a sequence of tasks that will be executed as part of the job
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x64, arm64]
os: [win, osx, linux]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.5

- name: Setup VSTest
uses: darenm/Setup-VSTest@v1

- name: Restore NuGet Packages
run: nuget restore Waratah\Waratah.sln

- name: Checkout
uses: actions/checkout@v2

- name: Setup
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
cache: true
cache-dependency-path: Waratah/*/packages.lock.json

- name: Restore
run: dotnet restore Waratah/Waratah.sln --locked-mode

- name: Build
run: msbuild Waratah\Waratah.sln /p:Configuration=Release

- name: Run Tests
run: vstest.console.exe Waratah\HidEngineTest\bin\Release\HidEngineTest.dll

- name: Upload Artifacts
run: dotnet build Waratah/Waratah.sln -c Release

- name: Publish
run: dotnet publish Waratah/WaratahCmd/WaratahCmd.csproj -c Release -r ${{ matrix.os }}-${{ matrix.arch }} -p:SelfContained=true

- name: Tar files
if: ${{ matrix.os != 'win' }}
run: |
tar cvf - "Waratah/WaratahCmd/bin/Release/net8.0/${{ matrix.os }}-${{ matrix.arch }}/publish/*" \
| gzip --best > waratah-${{ matrix.os }}-${{ matrix.arch }}.tar.gz

- name: Upload Tar
uses: actions/upload-artifact@v4.0.0
if: ${{ matrix.os != 'win' }}
with:
name: waratah-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
path: waratah-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
compression-level: 9

- name: Upload Zip
uses: actions/upload-artifact@v4.0.0
if: ${{ matrix.os == 'win' }}
with:
name: Waratah-Published
path: Waratah\WaratahCmd\bin\Release
name: waratah-${{ matrix.os }}-${{ matrix.arch }}.zip
path: Waratah/WaratahCmd/bin/Release/net8.0/${{ matrix.os }}-${{ matrix.arch }}/publish/
compression-level: 9
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

.direnv/
/result
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,47 @@ Or from the Winget console:
> winget install Microsoft.HIDTools.Waratah
> waratahcmd --source Z:\foo.wara

## Install from Nix Flake

```nix
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
waratah-flake = {
url = "github:CharaChorder/hidtools";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
{
self,
nixpkgs,
flake-utils,
waratah-flake,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
waratah = waratah-flake.legacyPackages.${system}.waratah;
})
];
};
in
rec {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ waratah ];
};
}
);
}
```

# Waratah

> What A Really Awesome Tool for Authoring HIDs
Expand Down
11 changes: 11 additions & 0 deletions Waratah/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);SA0001</NoWarn>
</PropertyGroup>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
Loading