Skip to content

Commit

Permalink
Launcher fixes (#425)
Browse files Browse the repository at this point in the history
* switch to CsWin32

* format

* make CheckResult private

* Fix warning by removing SecurityAttributes

* remove superfluous WriteLine

* improve error message if WSL is not enabled

* Add global exception handler

* Remove StartupHelper (no longer needed because of native systemd)

* configure code style

* fix analysis warnings

* run formatter; fix naming

* Replace a try {} I missed

* Do not keep working directory if invoked without arguments

* Enable Lockfile

* use setup-dotnet action

* skip downloading artifact as it is re-built anyway

* remove unused import

* Move string constants to resource file

* Add german translations

* Fix CA1305

* Check dotnet with ReSharper

* fix linter warnings

* dotnet format

* make FindTarball private

* improve ci job names

* remove NixosWslVersion class
  • Loading branch information
nzbr committed Jun 9, 2024
1 parent d6003e5 commit 1b7a178
Show file tree
Hide file tree
Showing 43 changed files with 1,360 additions and 424 deletions.
24 changes: 24 additions & 0 deletions .github/actions/setup-dotnet/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
outputs:
dotnet-version:
value: ${{ steps.setup-dotnet.outputs.dotnet-version }}

runs:
using: 'composite'
steps:
- name: Setup MSBuild # Needed for APPX packaging
uses: microsoft/setup-msbuild@v1.3
with:
vs-version: '[17.2,'

- name: Setup .NET SDK
id: setup-dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
cache: true
cache-dependency-path: 'Launcher/Launcher/packages.lock.json'

- name: Run NuGet restore
shell: pwsh
working-directory: 'Launcher'
run: nuget restore
7 changes: 0 additions & 7 deletions .github/actions/setup-msbuild/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
CERT_ALGORITHM: ${{ secrets.CERT_ALGORITHM }}

checks:
name: Flake Checks 📋
name: Checks 📋
uses: ./.github/workflows/run_checks.yml

tests:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
with:
fetch-depth: 0

- name: Setup MSBuild 🧰
uses: ./.github/actions/setup-msbuild
- name: Setup .NET 🧰
uses: ./.github/actions/setup-dotnet

- name: Set Versions 🏷️
uses: ./.github/actions/version
Expand Down
39 changes: 37 additions & 2 deletions .github/workflows/run_checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Flake Checks
name: Checks

on:
workflow_call: {}
Expand All @@ -24,7 +24,7 @@ jobs:
nix-instantiate --json --eval --strict -E 'with builtins; attrNames (getFlake (toString ./.)).checks.${currentSystem}' | perl -pe 's|(.*)|checks=\1|' >>$GITHUB_OUTPUT
checks:
name: Check 📋
name: Flake Check ❄️
needs:
- prepare
strategy:
Expand All @@ -44,3 +44,38 @@ jobs:
- name: Run Check 📋
run: |
nix build -L --impure --expr "with builtins; (getFlake (toString ./.)).checks.\${currentSystem}.${{ matrix.check }}"
resharper:
name: Check .NET 📋
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET 🧰
id: setup-dotnet
uses: ./.github/actions/setup-dotnet

- name: Install ReSharper Command Line Tools 🧰
shell: pwsh
run: dotnet tool install -g JetBrains.ReSharper.GlobalTools

- name: Create dummy tarball
shell: pwsh
run: echo $null >> Launcher\Launcher-Appx\nixos-wsl.tar.gz

- name: Run InspectCode 🔍
shell: pwsh
run: jb inspectcode --build -f=sarif -o="report.json" .\Launcher\Launcher.sln

- name: Print Report 📋
shell: pwsh
run: |
$(cat .\report.json | ConvertFrom-Json).runs[0].results | % {
$level = "warning"
if ($_.level -eq "note") { $level = "notice" }
$loc = $_.locations[0].physicalLocation
Write-Output "::${level} file=Launcher/$($loc.artifactLocation.uri),line=$($loc.region.startLine),endLine=$($loc.region.endLine),title=$($_.ruleId)::$($_.message.text)"
}
21 changes: 5 additions & 16 deletions .github/workflows/run_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,17 @@ jobs:
uses: actions/download-artifact@v4
with:
name: tarball
path: Launcher/Launcher-Appx

- name: Download launcher binaries 📥
uses: actions/download-artifact@v4
with:
name: launcher-bin
path: Launcher/Launcher/

- name: Bundle tarball with launcher 📦
run: |
Copy-Item nixos-wsl.tar.gz Launcher\Launcher-Appx\
- name: Setup MSBuild 🧰
uses: ./.github/actions/setup-msbuild
- name: Setup .NET 🧰
uses: ./.github/actions/setup-dotnet

- name: Set Versions 🏷️
uses: ./.github/actions/version

- name: Build MSIX package 📦
run: |
cd Launcher
nuget restore
msbuild Launcher-Appx\Launcher-Appx.wapproj /p:Configuration=Release /p:Platform=x64 /p:ContinuousIntegrationBuild=true /p:Deterministic=true
working-directory: Launcher
run: msbuild Launcher-Appx\Launcher-Appx.wapproj /p:Configuration=Release /p:Platform=x64 /p:ContinuousIntegrationBuild=true /p:Deterministic=true

- name: Sign package ✒️
env:
Expand Down
Loading

0 comments on commit 1b7a178

Please sign in to comment.