Skip to content

Commit

Permalink
Github stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
LordMike committed Jan 10, 2022
1 parent 5efb06c commit a900b84
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 11 deletions.
Empty file added .ci-skip-tests
Empty file.
46 changes: 46 additions & 0 deletions .github/workflows/dotnet-release-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Binary releases

on:
push:
tags: [ 0.*, 1.*, test-* ]

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 50
- run: git fetch --tags

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: "[ -f .ci-skip-tests ] && echo 'Skipping tests' || dotnet test --no-build --verbosity normal"

- name: Pack
if: github.ref == 'refs/heads/master'
run: |
dotnet publish -o Build/win-x64 -r win-x64 --self-contained -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true
dotnet publish -o Build/linux-x64 -r linux-x64 --self-contained -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true
dotnet publish -o Build/osx-x64 -r osx-x64 --self-contained -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true
- name: Promote to release
uses: softprops/action-gh-release@v1
with:
files: |
Build/**
55 changes: 55 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Generic Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 50
- run: git fetch --tags

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: "[ -f .ci-skip-tests ] && echo 'Skipping tests' || dotnet test --no-build --verbosity normal"

- name: Pack
if: github.ref == 'refs/heads/master'
run: dotnet pack -c Debug -o Build

- name: "Github packages: Nuget push"
if: github.ref == 'refs/heads/master'
run: dotnet nuget push --no-symbols 1 --skip-duplicate -k ${{ secrets.GITHUB_TOKEN }} -s "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" Build/*.nupkg

- name: "Github packages: Cleanup"
if: github.ref == 'refs/heads/master'
uses: stripethree/gpr-janitor@dist
with:
dry-run: false
keep-versions: 25
min-age-days: 14
versions-to-fetch: 20
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
.vs/
bin/
obj/
.vs/
*.user
Build/

# Files for local dev
*.user
*.local.json

# Verify
# https://github.com/VerifyTests/Verify#received-and-verified
*.received.*
46 changes: 46 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<!-- Common NuGet properties -->
<PropertyGroup>
<Authors>LordMike</Authors>
<Company>MBWarez</Company>
<Copyright>Michael Bisbjerg $([System.DateTime]::Now.ToString(yyyy))</Copyright>
</PropertyGroup>

<!-- Release stuff -->
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!-- Ignore warning CS1591 'Missing XML comment for publicly visible type or member' -->
<NoWarn>$(NoWarn);CS1591</NoWarn>

<DebugType>portable</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<MinVerTagPrefix>v</MinVerTagPrefix>

<!-- Github packages does not support symbols, so we embed pdbs in nupkg (https://github.community/t/does-github-packages-dotnet-nuget-supports-to-publish-snupkg/123286/6) -->
<AllowedOutputExtensionsInPackageBuildOutputFolder Condition="'$(Configuration)'=='Debug'">$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="2.5.0" PrivateAssets="all" />
</ItemGroup>

<!-- Sourcelink -->
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>

<Import Project="_Imports\Local.targets" Condition="Exists('_Imports\Local.targets')" />

</Project>
13 changes: 13 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MBW.Tools.ZwaveJs2Mqtt

Utility to test out new features utilizing the API of [Zwavejs2mqtt](https://github.com/zwave-js/zwavejs2mqtt/).

This code is my personal testing grounds that I also use for configuration management. It is _not_ for general consumption.

# Download

You can download the binaries from the [latest release](https://github.com/LordMike/MBW.Tools.ZwaveJs2Mqtt/releases/latest).

# Read more

This was first mentioned in this [show & tell discussion](https://github.com/zwave-js/zwavejs2mqtt/discussions/2137).
10 changes: 1 addition & 9 deletions ZwaveMqttTemplater/ZwaveMqttTemplater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,13 +25,4 @@
<EmbeddedResource Include="docs\*.json" />
</ItemGroup>

<ItemGroup>
<None Update="HassDevices.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="DeviceConfigsFile.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

0 comments on commit a900b84

Please sign in to comment.