Skip to content
Merged
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
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: '"%programfiles(x86)%/Inno Setup 6/iscc.exe" "setup/MSURandomizer.iss"'
shell: cmd
- name: Sync version from Library to App and rebuild
if: ${{ github.event_name != 'pull_request' }}
run: |
$libContent = Get-Content -Path "MSURandomizerLibrary/MSURandomizerLibrary.csproj" -Raw
if ($libContent -match '<Version>(?<version>.*?)</Version>') {
$version = $Matches['version']
Write-Host "Syncing version $version to MSURandomizer/MSURandomizer.csproj"
(Get-Content -Path "MSURandomizer/MSURandomizer.csproj") -replace '<Version>.*?</Version>', "<Version>$version</Version>" | Set-Content -Path "MSURandomizer/MSURandomizer.csproj"
dotnet build MSURandomizer/MSURandomizer.csproj -c Release --no-restore -p:PostBuildEvent=
} else {
Write-Error "Could not find version in MSURandomizerLibrary/MSURandomizerLibrary.csproj"
exit 1
}
shell: pwsh
- name: Copy Nuget Packages
if: ${{ github.event_name != 'pull_request' }}
working-directory: setup
Expand Down Expand Up @@ -92,14 +106,23 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore dependencies
if: ${{ github.event_name == 'pull_request' }}
run: dotnet restore
- name: Build
if: ${{ github.event_name == 'pull_request' }}
run: dotnet build --no-restore -p:PostBuildEvent=
- name: Install PupNet
if: ${{ github.event_name != 'pull_request' }}
run: dotnet tool install -g KuiperZone.PupNet
- name: Download AppImageTool
if: ${{ github.event_name != 'pull_request' }}
run: |
wget -P "$HOME/.local/bin" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x "$HOME/.local/bin/appimagetool-x86_64.AppImage"
appimagetool-x86_64.AppImage --version
- name: Run PupNet
if: ${{ github.event_name != 'pull_request' }}
run: |
version_number="${{ needs.build-windows.outputs.version-number }}"
base_version="${version_number%%-*}"
Expand Down Expand Up @@ -163,19 +186,24 @@ jobs:

needs: [build-windows, build-linux]

if: ${{ github.event_name != 'pull_request' }}

permissions:
contents: write

steps:
- uses: actions/download-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
name: MSURandomizerWindows
path: out
- uses: actions/download-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
name: MSURandomizerLinux
path: out
- uses: actions/download-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
name: MSURandomizerMac
path: out
Expand All @@ -186,6 +214,7 @@ jobs:
path: "out/*"
name: MSURandomizer_${{ needs.build-windows.outputs.version-number }}
- name: Delete old artifacts
if: ${{ github.event_name != 'pull_request' }}
uses: geekyeggo/delete-artifact@v5
with:
name: |
Expand Down
2 changes: 1 addition & 1 deletion MSURandomizer/MSURandomizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>3.2.4-beta.3</Version>
<Version>3.2.1</Version>
<ApplicationIcon>MSURandomizerIcon.ico</ApplicationIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>MattEqualsCoder.MSURandomizer.Avalonia</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion MSURandomizerLibrary/MSURandomizerLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<IncludeSymbols>False</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>3.2.4-beta.2</Version>
<Version>3.2.4</Version>
<PackageId>MattEqualsCoder.MSURandomizer.Library</PackageId>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
Expand Down
10 changes: 9 additions & 1 deletion MSURandomizerLibrary/Services/MsuSelectorService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Logging;
using MSURandomizerLibrary.Configs;
using MSURandomizerLibrary.Messenger;
Expand Down Expand Up @@ -445,6 +446,8 @@ private MsuSelectorResponse SaveMsuInternal(Msu msu, string outputPath, Msu? pre
_ = _msuMessageSender.SendMsuGenerated(outputMsu);
}

_logger.LogInformation("MSU save {Status}: {Message}", response.Successful ? "successful" : "unsuccessful", response.Message);

return response;
}

Expand Down Expand Up @@ -538,7 +541,12 @@ private bool CreatePcmFile(string source, string destination)
{
if (OperatingSystem.IsWindows())
{
NativeMethods.CreateHardLink(destination, source, IntPtr.Zero);
if (!NativeMethods.CreateHardLink(destination, source, IntPtr.Zero))
{
var error = Marshal.GetLastWin32Error();
_logger.LogError("Failed to create hard link for {Destination} to {Source}: Error {Code}", destination, source, error);
return false;
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion MSURandomizerLibraryTests/MSURandomizerLibraryTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsPackable>false</IsPackable>

<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading