Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Icons, Register.exe/Unregister.exe, and CI #40

Merged
merged 41 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bea1d4e
Add CI
nref Oct 27, 2024
1a0692f
Add CI
nref Oct 27, 2024
974b690
Add CI
nref Oct 27, 2024
0a463f4
Troubleshooting sign error
nref Oct 27, 2024
4ab67ec
Troubleshooting
nref Oct 27, 2024
03f57bf
Think I got it...
nref Oct 27, 2024
74f2a39
Add temp tag
nref Oct 27, 2024
fd678a3
Zip up release
nref Oct 27, 2024
50f8edd
Use ci-stage tag
nref Oct 27, 2024
a56f79e
trigger build
nref Oct 27, 2024
f814f37
Trying to glob zip files
nref Oct 27, 2024
edaff4c
Provide full path to artifacts
nref Oct 27, 2024
9a9ab9b
Rename App/ to BrowseRouter/
nref Oct 27, 2024
6b560da
Rename App/ to BrowseRouter/
nref Oct 27, 2024
8f0c751
Use more colorful icon. Add Register.exe, Unregister.exe. Get tag fro…
nref Oct 27, 2024
f2017f1
Fix tag
nref Oct 27, 2024
6b9e51b
fix tag
nref Oct 27, 2024
04f7437
fix tag
nref Oct 27, 2024
7a419fc
fix tag
nref Oct 27, 2024
eb0ade0
fix tag
nref Oct 27, 2024
9be7922
fig tag
nref Oct 27, 2024
df0d392
fix tag
nref Oct 27, 2024
da29b14
ps2 => ps1
nref Oct 28, 2024
4d94911
Still trying to get version to tag
nref Oct 28, 2024
30c0512
Still trying to get version to tag
nref Oct 28, 2024
a66dc97
Still trying to get version to tag
nref Oct 28, 2024
5f53bc0
Still trying to get version to tag
nref Oct 28, 2024
2fe31d1
Still trying to get version to tag
nref Oct 28, 2024
d9a8015
Still trying to get version to tag
nref Oct 28, 2024
25e8816
Use powershellese
nref Oct 28, 2024
668f028
Use PR title and description
nref Oct 28, 2024
871f5ba
Use PR title and description
nref Oct 28, 2024
a517d2d
Use PR title and description
nref Oct 28, 2024
91b6d28
Use PR title and description
nref Oct 28, 2024
792fdd7
Use PR title and description
nref Oct 28, 2024
00eb327
Use PR title and description
nref Oct 28, 2024
d2227e9
Use PR title and description
nref Oct 28, 2024
ba0c515
Use PR title and description
nref Oct 28, 2024
216a77c
Use body file
nref Oct 28, 2024
4134207
Use body file
nref Oct 28, 2024
8efe645
Use body file
nref Oct 28, 2024
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
26 changes: 0 additions & 26 deletions .github/workflows/dotnet.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run Tests

permissions:
contents: read
issues: read
checks: write
pull-requests: write

on:
workflow_dispatch:
pull_request:
types: ['opened', 'reopened', 'synchronize', 'ready_for_review']

paths:
- '**'

env:
DOTNET_SDK_VERSION: 8.0
SOLUTION_PATH: "BrowseRouter.sln"

jobs:

test:
runs-on: ubuntu-latest
defaults:
run:
# ./ is the repo root
working-directory: ./

steps:
- uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}

- name: Build
run: dotnet build --configuration Release

- name: Run dotnet test
run: dotnet test ${{ env.SOLUTION_PATH }} --configuration Release --results-directory test-results --logger "trx;LogFilePrefix=TestResults"

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/*.trx
60 changes: 60 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build for Windows
on:
workflow_dispatch:
pull_request:
types: ['opened', 'reopened', 'synchronize', 'ready_for_review']
paths:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Build:
name: Build on self-hosted
runs-on: m2mini-win11
permissions:
contents: write
defaults:
run:
# ./ is the repo root
working-directory: ./
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Get version
run: |
$version = ./Get-ProjectVersion.ps1 -ProjectPath BrowseRouter
echo "VERSION=$version" >> $env:GITHUB_ENV

- name: Get PR URL
run: |
$pr = ${{ github.event.pull_request.number }}
$url = "https://github.com/nref/BrowseRouter/pull/$pr"
echo "PR_URL=$url" >> $env:GITHUB_ENV

- name: Get PR Title and Description
run: |
$title=$(gh pr view $env:PR_URL --json title -q .title)
$description=$(gh pr view $env:PR_URL --json body -q .body)
echo $description > pr_description.md
echo "PR_TITLE=$title" >> $env:GITHUB_ENV
echo "PR_DESCRIPTION_FILE=pr_description.md" >> $env:GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build and sign
run: pwsh ./make.ps1

- uses: ncipollo/release-action@v1
with:
artifacts: "./Releases/**/*.zip"
draft: true
allowUpdates: true
tag: ${{ env.VERSION }}
name: ${{ env.VERSION }} - ${{ env.PR_TITLE }}
bodyFile: ${{ env.PR_DESCRIPTION_FILE }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
bin
obj
publish
Releases
**/*.user
**/*.crt
Binary file removed App/logo.ico
Binary file not shown.
Binary file removed App/logo.png
Binary file not shown.
21 changes: 0 additions & 21 deletions App/publish.ps1

This file was deleted.

32 changes: 25 additions & 7 deletions BrowseRouter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,50 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowseRouter", "App\BrowseRouter.csproj", "{39E2D988-557D-40D2-9D0B-AAC097FE98C5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{42958659-9C5D-4FD0-97A3-D65DEE66523C}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
Decode-FromBase64.ps1 = Decode-FromBase64.ps1
Directory.Build.props = Directory.Build.props
Get-ProjectVersion.ps1 = Get-ProjectVersion.ps1
make.ps1 = make.ps1
Publish-And-Sign.ps1 = Publish-And-Sign.ps1
README.md = README.md
.github\workflows\test.yml = .github\workflows\test.yml
.github\workflows\windows.yml = .github\workflows\windows.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserRouter.Tests", "Tests\BrowserRouter.Tests\BrowserRouter.Tests.csproj", "{90964780-A852-4B1E-9D61-93CA1FB6E27E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unregister", "Unregister\Unregister.csproj", "{28058E4A-C2EF-4044-888B-7038CAF5BFD7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Register", "Register\Register.csproj", "{9387B6CF-1705-4A6F-8723-B729F167829D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowseRouter", "BrowseRouter\BrowseRouter.csproj", "{59BE57B7-9A45-432C-9ACB-99B05B9834EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39E2D988-557D-40D2-9D0B-AAC097FE98C5}.Release|Any CPU.Build.0 = Release|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90964780-A852-4B1E-9D61-93CA1FB6E27E}.Release|Any CPU.Build.0 = Release|Any CPU
{28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28058E4A-C2EF-4044-888B-7038CAF5BFD7}.Release|Any CPU.Build.0 = Release|Any CPU
{9387B6CF-1705-4A6F-8723-B729F167829D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9387B6CF-1705-4A6F-8723-B729F167829D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9387B6CF-1705-4A6F-8723-B729F167829D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9387B6CF-1705-4A6F-8723-B729F167829D}.Release|Any CPU.Build.0 = Release|Any CPU
{59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59BE57B7-9A45-432C-9ACB-99B05B9834EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
11 changes: 0 additions & 11 deletions App/BrowseRouter.csproj → BrowseRouter/BrowseRouter.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Nullable>enable</Nullable>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<WarningLevel>4</WarningLevel>
<ApplicationIcon>logo.ico</ApplicationIcon>
<Version>0.10.0</Version>
<PublishTrimmed>true</PublishTrimmed>
<!-- Reduces flagging as malware -->
<NoWin32Manifest>true</NoWin32Manifest>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<!-- Reduces flagging as malware -->
<DebugType>embedded</DebugType>
</PropertyGroup>

<Target Name="CopyAssets" BeforeTargets="PrepareForBuild">
<Copy SourceFiles="$(ProjectDir)logo.ico" DestinationFiles="$(TargetDir)logo.ico" />
</Target>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added BrowseRouter/logo.ico
Binary file not shown.
Binary file added BrowseRouter/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
24 changes: 24 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project>
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<!-- TODO enable when all warnings are resolved -->
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Version>0.11.0</Version>
<Product>BrowseRouter</Product>
<Copyright>EnduraByte LLC 2024</Copyright>
<!-- Reduces flagging as malware -->
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<!-- Reduces flagging as malware -->
<DebugType>embedded</DebugType>
</PropertyGroup>

<Target Name="GetVersion">
<Message Importance="high" Text="$(Version)" />
</Target>
</Project>
8 changes: 8 additions & 0 deletions Get-ProjectVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
param (
[string]$ProjectPath
)

$output = dotnet msbuild $ProjectPath -target:GetVersion -nologo -q
$version = $output.Trim()

return $version
15 changes: 15 additions & 0 deletions Publish-And-Sign.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
param (
[string]$ExeName,
[string]$CertPath
)

$certKey = $env:ENDURABYTE_WINDOWS_CODE_SIGN_KEY
$signTool = "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe"
$rids = @("win-x64", "win-arm64")

# dotnet does not support publishing multiple RIDs in parallel
foreach ($rid in $rids) {
dotnet publish /p:PublishProfile=$rid --configuration Release
. $signTool sign /f "$CertPath" /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com `
/csp "SafeNet Smart Card Key Storage Provider" /k $certKey /v "./publish/$rid/$ExeName"
}
9 changes: 9 additions & 0 deletions Register/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Diagnostics;

Process.Start(new ProcessStartInfo
{
FileName = "BrowseRouter",
Arguments = "", // No args means register
UseShellExecute = true
});

17 changes: 17 additions & 0 deletions Register/Properties/PublishProfiles/win-arm64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>publish\win-arm64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
</Project>
17 changes: 17 additions & 0 deletions Register/Properties/PublishProfiles/win-x64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>publish\win-x64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions Register/Register.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishTrimmed>true</PublishTrimmed>
<ApplicationIcon>logo.ico</ApplicationIcon>
</PropertyGroup>

</Project>
Binary file added Register/logo.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion Tests/BrowserRouter.Tests/BrowserRouter.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\App\BrowseRouter.csproj" />
<ProjectReference Include="..\..\BrowseRouter\BrowseRouter.csproj" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions Unregister/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Diagnostics;

Process.Start(new ProcessStartInfo
{
FileName = "BrowseRouter",
Arguments = "--unregister",
UseShellExecute = true
});

17 changes: 17 additions & 0 deletions Unregister/Properties/PublishProfiles/win-arm64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>publish\win-arm64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
</Project>
Loading
Loading