Skip to content

Commit

Permalink
Merge branch 'more-ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrottel committed May 13, 2024
2 parents fbcc4a5 + c1011a0 commit 4fcb153
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 48 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/DimMon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: DimMon Build Action

on:
push:
branches: [ "main" ]
paths:
- .github/workflows/DimMon.yaml
- DimMon/**
pull_request:
branches: [ "main" ]
paths:
- .github/workflows/DimMon.yaml
- DimMon/**
workflow_dispatch:

jobs:
build:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore --arch x64 ./DimMon/DimMon.sln

- name: Inject build number
shell: pwsh
run: |
$csproj = New-Object System.XML.XMLDocument
$csprojPath = Resolve-Path "./DimMon/DimMon.csproj"
$csproj.Load($csprojPath)
$version = New-Object System.Version $csproj.Project.PropertyGroup.Version
$version = New-Object System.Version @( $version.Major, $version.Minor, ([System.Math]::Max(0, $version.Build)), $env:GITHUB_RUN_NUMBER )
Write-Host "Version number: $version"
$csproj.Project.PropertyGroup.Version = $version.ToString()
$csproj.Save($csprojPath)
Write-Output "FULL_VERSION_NUMBER=$version" >> $env:GITHUB_ENV
- name: Build
run: dotnet build --configuration ${{ matrix.configuration }} --arch x64 --no-restore ./DimMon/DimMon.csproj

- name: Publish
if: ${{ matrix.configuration == 'Release' }}
run: dotnet publish --configuration Release -p:PublishProfile=FolderProfile -p:DebugType=None -p:DebugSymbols=false --no-build --no-restore ./DimMon/DimMon.csproj

- name: Copy Extra Files
if: ${{ matrix.configuration == 'Release' }}
shell: pwsh
run: |
copy .\LICENSE .\DimMon\bin\Publish\
.\Scripts\makeProjReadme.ps1 DimMon .\DimMon\bin\Publish\README.md
- name: Upload Artifacts
if: ${{ matrix.configuration == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: DimMon-${{env.FULL_VERSION_NUMBER}}
path: |
DimMon/bin/publish
!**/*.pdb
if-no-files-found: error
72 changes: 72 additions & 0 deletions .github/workflows/TestConApp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: TestConApp Build Action

on:
push:
branches: [ "main" ]
paths:
- .github/workflows/TestConApp.yaml
- TestConApp/**
pull_request:
branches: [ "main" ]
paths:
- .github/workflows/TestConApp.yaml
- TestConApp/**
workflow_dispatch:

jobs:
build:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore ./TestConApp/TestConApp.sln

- name: Inject build number
shell: pwsh
run: |
$csproj = New-Object System.XML.XMLDocument
$csprojPath = Resolve-Path "./TestConApp/TestConApp.csproj"
$csproj.Load($csprojPath)
$version = New-Object System.Version $csproj.Project.PropertyGroup.Version
$version = New-Object System.Version @( $version.Major, $version.Minor, ([System.Math]::Max(0, $version.Build)), $env:GITHUB_RUN_NUMBER )
Write-Host "Version number: $version"
$csproj.Project.PropertyGroup.Version = $version.ToString()
$csproj.Save($csprojPath)
Write-Output "FULL_VERSION_NUMBER=$version" >> $env:GITHUB_ENV
- name: Build
run: dotnet build --configuration ${{ matrix.configuration }} --no-restore ./TestConApp/TestConApp.csproj

- name: Publish
if: ${{ matrix.configuration == 'Release' }}
run: dotnet publish --configuration Release -p:PublishProfile=FolderProfile -p:DebugType=None -p:DebugSymbols=false --no-build --no-restore ./TestConApp/TestConApp.csproj

- name: Copy Extra Files
if: ${{ matrix.configuration == 'Release' }}
shell: pwsh
run: |
copy .\LICENSE .\TestConApp\bin\Publish\
.\Scripts\makeProjReadme.ps1 TestConApp .\TestConApp\bin\Publish\README.md
- name: Upload Artifacts
if: ${{ matrix.configuration == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: TestConApp-${{env.FULL_VERSION_NUMBER}}
path: |
TestConApp/bin/publish
!**/*.pdb
if-no-files-found: error
40 changes: 20 additions & 20 deletions DimMon/DimMon.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Title>DimMon</Title>
<ApplicationIcon>images\sunglasses.ico</ApplicationIcon>
<Version>1.0.0</Version>
<Authors>SGrottel</Authors>
<Description>Dims monitors by transparent black overlaying windows.</Description>
<Copyright>2023, by SGrottel</Copyright>
</PropertyGroup>

<ItemGroup>
<Content Include="images\sunglasses.ico" />
</ItemGroup>

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Title>DimMon</Title>
<ApplicationIcon>images\sunglasses.ico</ApplicationIcon>
<Version>1.0.1</Version>
<Authors>SGrottel</Authors>
<Description>Dims monitors by transparent black overlaying windows.</Description>
<Copyright>2023-2024, by SGrottel</Copyright>
</PropertyGroup>

<ItemGroup>
<Content Include="images\sunglasses.ico" />
</ItemGroup>

</Project>
34 changes: 17 additions & 17 deletions DimMon/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>
Binary file added DimMon/images/sunglasses_x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ Also, good enough.
## Dib
Desktop Icon Backup

## DimMon
## DimMon <img align="left" src="./DimMon/images/sunglasses_x48.png" style="height:1em" alt="DimMon">
[![DimMon Build Action](https://github.com/sgrottel/tiny-tools-collection/actions/workflows/DimMon.yaml/badge.svg)](https://github.com/sgrottel/tiny-tools-collection/actions/workflows/DimMon.yaml)

C# app to dim monitors by displaying an transparent black overlaying window.
The idea is to dim "other" monitors when watching a video or playing a game one only one of the monitors.

Expand Down Expand Up @@ -94,6 +96,8 @@ A small GUI, slapped together in C#, around the Shutdown command-line utility.
Trivial tool to start Pwsh.exe and provide an icon. Because...

## TestConApp
[![TestConApp Build Action](https://github.com/sgrottel/tiny-tools-collection/actions/workflows/TestConApp.yaml/badge.svg)](https://github.com/sgrottel/tiny-tools-collection/actions/workflows/TestConApp.yaml)

Simple little console application usable in tests, to check whether a process is correctly called.
It echoes it's command line arguments and a couple of diagnostic properties.

Expand Down
15 changes: 15 additions & 0 deletions TestConApp/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net8.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
21 changes: 11 additions & 10 deletions TestConApp/TestConApp.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
</PropertyGroup>

</Project>

0 comments on commit 4fcb153

Please sign in to comment.