Skip to content
Open
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
35 changes: 35 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dotnet Build

on:
push:
branches:
- '**'
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
env:
BUILD_CONFIGURATION: Release
SDK_VERSION: 10.0.201
steps:
- name: Checkout repository
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git init
git remote add origin "https://x-access-token:${env:GITHUB_TOKEN}@github.com/${env:GITHUB_REPOSITORY}.git"
git fetch --depth=1 origin "${env:GITHUB_SHA}"
git checkout --force FETCH_HEAD
- name: Install .NET SDK
shell: pwsh
run: |
$installScript = Join-Path $env:RUNNER_TEMP "dotnet-install.ps1"
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript
& $installScript -Version "${env:SDK_VERSION}" -InstallDir "$env:RUNNER_TEMP\dotnet"
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\dotnet"
- name: Restore
run: dotnet restore SystemTrayMenu.csproj
- name: Build
run: dotnet build SystemTrayMenu.csproj -c ${{ env.BUILD_CONFIGURATION }} --no-restore
66 changes: 66 additions & 0 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Dotnet Release

on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write

jobs:
release:
runs-on: windows-latest
env:
BUILD_CONFIGURATION: Release
SDK_VERSION: 10.0.201
OUTPUT_DIR: bin\AnyCPU\Release\net10.0-windows10.0.22000.0\win-x64
steps:
- name: Checkout repository
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git init
git remote add origin "https://x-access-token:${env:GITHUB_TOKEN}@github.com/${env:GITHUB_REPOSITORY}.git"
git fetch --depth=1 origin "${env:GITHUB_SHA}"
git checkout --force FETCH_HEAD
- name: Install .NET SDK
shell: pwsh
run: |
$installScript = Join-Path $env:RUNNER_TEMP "dotnet-install.ps1"
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript
& $installScript -Version "${env:SDK_VERSION}" -InstallDir "$env:RUNNER_TEMP\dotnet"
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\dotnet"
- name: Restore
run: dotnet restore SystemTrayMenu.csproj
- name: Build
run: dotnet build SystemTrayMenu.csproj -c ${{ env.BUILD_CONFIGURATION }} --no-restore
- name: Create release archive
shell: pwsh
run: |
$archiveName = "SystemTrayMenu-${env:GITHUB_REF_NAME}-win-x64.zip"
$archivePath = Join-Path $env:RUNNER_TEMP $archiveName
if (Test-Path $archivePath)
{
Remove-Item $archivePath -Force
}

Compress-Archive -Path "${env:OUTPUT_DIR}\*" -DestinationPath $archivePath
Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_ASSET_PATH=$archivePath"
Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_ASSET_NAME=$archiveName"
- name: Publish GitHub Release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view "${env:GITHUB_REF_NAME}" --repo "${env:GITHUB_REPOSITORY}" *> $null
if ($LASTEXITCODE -eq 0)
{
gh release upload "${env:GITHUB_REF_NAME}" "${env:RELEASE_ASSET_PATH}#${env:RELEASE_ASSET_NAME}" --repo "${env:GITHUB_REPOSITORY}" --clobber
}
else
{
gh release create "${env:GITHUB_REF_NAME}" "${env:RELEASE_ASSET_PATH}#${env:RELEASE_ASSET_NAME}" --repo "${env:GITHUB_REPOSITORY}" --generate-notes
}
16 changes: 0 additions & 16 deletions .github/workflows/dotnetframework.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-dotnettools.csharp",
"ms-dotnettools.csdevkit"
]
}
72 changes: 72 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "SystemTrayMenu: Rebuild + Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "stm: build Debug",
"program": "${workspaceFolder}/bin/AnyCPU/Debug/net10.0-windows10.0.22000.0/win-x64/SystemTrayMenu.exe",
"cwd": "${workspaceFolder}",
"env": {
"STM_DEBUG_ALLOW_MULTI_INSTANCE": "1"
},
"stopAtEntry": false,
"justMyCode": true,
"console": "internalConsole",
"internalConsoleOptions": "neverOpen",
"logging": {
"moduleLoad": false,
"programOutput": true,
"exceptions": true,
"diagnosticsLog": {
"protocolMessages": false
},
"browserStdOut": false,
"browserStdErr": false
}
},
{
"name": "SystemTrayMenu: Build + Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "stm: build Debug",
"program": "${workspaceFolder}/bin/AnyCPU/Debug/net10.0-windows10.0.22000.0/win-x64/SystemTrayMenu.exe",
"cwd": "${workspaceFolder}",
"env": {
"STM_DEBUG_ALLOW_MULTI_INSTANCE": "1"
},
"stopAtEntry": false,
"justMyCode": true,
"console": "internalConsole",
"internalConsoleOptions": "neverOpen",
"logging": {
"moduleLoad": false,
"programOutput": true,
"exceptions": true,
"diagnosticsLog": {
"protocolMessages": false
},
"browserStdOut": false,
"browserStdErr": false
}
},
{
"name": "SystemTrayMenu: Attach to Process",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}",
"justMyCode": true,
"logging": {
"moduleLoad": false,
"programOutput": true,
"exceptions": true,
"diagnosticsLog": {
"protocolMessages": false
},
"browserStdOut": false,
"browserStdErr": false
}
}
]
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"dotnet.defaultSolution": "SystemTrayMenu.slnx",
"debug.internalConsoleOptions": "neverOpen",
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.enableEditorConfigSupport": true,
"csharp.suppressBuildAssetsNotification": true,
"files.exclude": {
"**/bin": true,
"**/obj": true
},
"search.exclude": {
"**/bin": true,
"**/obj": true
}
}
106 changes: 106 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "stm: stop running instances",
"type": "shell",
"command": "pwsh",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-Command",
"$processes = @(Get-Process -Name SystemTrayMenu -ErrorAction SilentlyContinue); foreach ($process in $processes) { Stop-Process -Id $process.Id -Force }; exit 0"
],
"problemMatcher": []
},
{
"label": "stm: restore",
"type": "shell",
"command": "dotnet",
"args": [
"restore",
"${workspaceFolder}/SystemTrayMenu.csproj"
],
"problemMatcher": "$msCompile"
},
{
"label": "stm: build Debug",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/SystemTrayMenu.csproj",
"-c",
"Debug"
],
"dependsOrder": "sequence",
"dependsOn": [
"stm: stop running instances",
"stm: restore"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
},
{
"label": "stm: watch run (Hot Reload)",
"type": "shell",
"command": "pwsh",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-Command",
"$env:STM_DEBUG_ALLOW_MULTI_INSTANCE='1'; dotnet watch --project \"${workspaceFolder}/SystemTrayMenu.csproj\" run -c Debug"
],
"dependsOrder": "sequence",
"dependsOn": [
"stm: stop running instances",
"stm: restore"
],
"isBackground": true,
"group": "none",
"problemMatcher": [
{
"owner": "dotnet-watch",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^(.*)\\((\\d+),(\\d+)\\):\\s*(error|warning)\\s*([A-Z]+\\d+):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".*dotnet watch.*",
"endsPattern": ".*(Hot reload enabled|Watching for file changes).*"
}
}
]
},
{
"label": "stm: watch test",
"type": "shell",
"command": "dotnet",
"args": [
"watch",
"--project",
"${workspaceFolder}/SystemTrayMenu.csproj",
"test",
"-c",
"Debug"
],
"isBackground": true,
"group": "test",
"problemMatcher": "$msCompile"
}
]
}
2 changes: 1 addition & 1 deletion Business/IpcPipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal string ReadString()

// Receive message
byte[] inBuffer = new byte[len];
ioStream.Read(inBuffer, 0, len);
ioStream.ReadExactly(inBuffer, 0, len);

return streamEncoding.GetString(inBuffer);
}
Expand Down
Loading
Loading