Enhance Installer
Test / Run tests (push) Failing after 13s

This commit is contained in:
2026-08-05 16:31:32 +02:00
parent bf8533c857
commit 9c3cc8d4be
10 changed files with 134 additions and 45 deletions
+56
View File
@@ -0,0 +1,56 @@
name: Deploy
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
jobs:
deploy:
name: Build and Deploy
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Set APP_VERSION variable from tag
shell: powershell
run: |
$APP_VERSION = $env:GITHUB_REF -replace '^refs/tags/v', ''
Add-Content -Path $env:GITHUB_ENV -Value "APP_VERSION=$APP_VERSION"
- name: Checkout repository
uses: actions/checkout@v4
- name: Check version in project
shell: powershell
run: |
Select-String PamhagenSysCtrl/PamhagenSysCtrl.csproj -Pattern "<Version>"
$res = Select-String PamhagenSysCtrl/PamhagenSysCtrl.csproj -Pattern "<Version>${{ env.APP_VERSION }}</Version>"
if ($res -eq $null) {
exit 1
}
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: Restore NuGet packages
shell: powershell
run: $(& nuget restore PamhagenSysCtrl.sln; $a=$lastexitcode) | findstr x*; exit $a
- name: Build Installer
shell: powershell
run: $(& msbuild -verbosity:quiet Installer/Installer.wixproj -property:Configuration=Release -property:Platform=x64; $a=$lastexitcode) | findstr x*; exit $a
- name: Rename artifact
shell: powershell
run: Move-Item Installer/bin/x64/Release/PamhagenSysCtrl.msi Installer/bin/x64/Release/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi
- name: Create release
uses: akkuman/gitea-release-action@v1
with:
name: Anlagensteuerung Pamhagen ${{ env.APP_VERSION }}
body: "**[Changelog](src/branch/main/CHANGELOG.md#v${{ env.APP_VERSION }})**"
files: |-
Installer/bin/x64/Release/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi
- name: Upload to website
shell: powershell
run: |
$content = [System.IO.File]::ReadAllBytes("Installer/bin/x64/Release/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi")
Invoke-WebRequest `
-Uri "https://elwig.at/files/PamhagenSysCtrl-${{ env.APP_VERSION }}.msi" `
-Method PUT `
-Body $content `
-Headers @{ Authorization = "${{ secrets.API_AUTHORIZATION }}" } `
-ContentType "application/octet-stream"
+25
View File
@@ -0,0 +1,25 @@
name: Test
on:
push:
branches: ["**"]
paths: ["PamhagenSysCtrl/**", ".gitea/workflows/test.yaml"]
jobs:
test:
name: Run tests
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for Byte order marks
shell: powershell
run: |
$pattern = [char]::ConvertFromUtf32(0xFEFF)
$files = git grep -IEl "^$pattern"
if ( $lastexitcode -ne 1 ) {
echo "Files with BOM found:"
echo $files
exit 1
} else {
echo "No files with BOM found"
exit 0
}
+6 -2
View File
@@ -3,8 +3,12 @@ Pamhagen
======== ========
Source code Source code
C:\Program Files\Pamhagen\src\PamhagenSysCtrl-source.zip C:\Program Files\Anlagensteuerung Pamhagen\src\pamhagen-sysctrl.zip
https://git.necronda.net/winzer/pamhagen-sysctrl https://git.necronda.net/winzer/pamhagen-sysctrl
Installation folder Installation folder
C:\Program Files\Pamhagen\ C:\Program Files\Anlagensteuerung Pamhagen\
Data and configuration folder
C:\ProgramData\Anlagensteuerung Pamhagen\
- config.ini : main configuration file
+3
View File
@@ -0,0 +1,3 @@
[plc]
port = COM1
+9 -1
View File
@@ -1,16 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment> <Fragment>
<!-- C:\Program Files (x86)\Anlagensteuerung Pamhagen or C:\Program Files\Anlagensteuerung Pamhagen -->
<StandardDirectory Id="ProgramFiles64Folder"> <StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.ProductName)"> <Directory Id="InstallFolder" Name="!(bind.Property.ProductName)">
<Directory Id="SourceFolder" Name="src" /> <Directory Id="SourceFolder" Name="src" />
</Directory> </Directory>
</StandardDirectory> </StandardDirectory>
<!-- C:\ProgramData\Anlagensteuerung Pamhagen -->
<StandardDirectory Id="CommonAppDataFolder">
<Directory Id="ConfigFolder" Name="!(bind.Property.ProductName)" />
</StandardDirectory>
<!-- C:\ProgramData\Microsoft\Windows\Start Menu\Programs -->
<StandardDirectory Id="ProgramMenuFolder"> <StandardDirectory Id="ProgramMenuFolder">
<Directory Id="StartMenuProgramsFolder" Name="!(bind.Property.ProductName)" /> <Directory Id="StartMenuProgramsFolder" Name="!(bind.Property.ProductName)" />
</StandardDirectory> </StandardDirectory>
<!-- C:\Users\{USERNAME}\Desktop -->
<StandardDirectory Id="DesktopFolder" /> <StandardDirectory Id="DesktopFolder" />
</Fragment> </Fragment>
</Wix> </Wix>
+7 -10
View File
@@ -8,10 +8,7 @@
<SuppressValidation>false</SuppressValidation> <SuppressValidation>false</SuppressValidation>
<PublishDirectory>$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\bin\Publish</PublishDirectory> <PublishDirectory>$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\bin\Publish</PublishDirectory>
</PropertyGroup> </PropertyGroup>
<UsingTask TaskName="GetFileVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<UsingTask TaskName="GetFileVersion"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup> <ParameterGroup>
<AssemblyPath ParameterType="System.String" Required="true" /> <AssemblyPath ParameterType="System.String" Required="true" />
<Version ParameterType="System.String" Output="true" /> <Version ParameterType="System.String" Output="true" />
@@ -23,7 +20,6 @@
]]></Code> ]]></Code>
</Task> </Task>
</UsingTask> </UsingTask>
<Target Name="PublishApplication" BeforeTargets="BeforeBuild"> <Target Name="PublishApplication" BeforeTargets="BeforeBuild">
<RemoveDir Directories="$(PublishDirectory)" Condition="Exists('$(PublishDirectory)')" /> <RemoveDir Directories="$(PublishDirectory)" Condition="Exists('$(PublishDirectory)')" />
<Exec Command="dotnet publish &quot;$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\PamhagenSysCtrl.csproj&quot; --configuration &quot;$(Configuration)&quot; --runtime win-x64 --self-contained true --output &quot;$(PublishDirectory)&quot; --nologo" /> <Exec Command="dotnet publish &quot;$(MSBuildProjectDirectory)\..\PamhagenSysCtrl\PamhagenSysCtrl.csproj&quot; --configuration &quot;$(Configuration)&quot; --runtime win-x64 --self-contained true --output &quot;$(PublishDirectory)&quot; --nologo" />
@@ -34,13 +30,14 @@
<DefineConstants>ProductVersion=$(ProductVersion);BuildPath=$(PublishDirectory)</DefineConstants> <DefineConstants>ProductVersion=$(ProductVersion);BuildPath=$(PublishDirectory)</DefineConstants>
</PropertyGroup> </PropertyGroup>
</Target> </Target>
<Target Name="CreateSourceArchive" BeforeTargets="BeforeBuild"> <Target Name="CreateSourceArchive" BeforeTargets="BeforeBuild">
<Exec Command="git -C &quot;$(MSBuildProjectDirectory)\..&quot; archive --format=zip --output &quot;$(MSBuildProjectDirectory)\Files\PamhagenSysCtrl-source.zip&quot; HEAD" /> <Exec Command="git -C &quot;$(MSBuildProjectDirectory)\..&quot; archive --format=zip --output &quot;$(MSBuildProjectDirectory)\Files\pamhagen-sysctrl.zip&quot; HEAD" />
</Target> </Target>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\PamhagenSysCtrl\PamhagenSysCtrl.csproj" <ProjectReference Include="..\PamhagenSysCtrl\PamhagenSysCtrl.csproj" ReferenceOutputAssembly="false" />
ReferenceOutputAssembly="false" /> </ItemGroup>
<ItemGroup>
<None Include="Files\config.ini" />
<None Include="Files\README.txt" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+15 -18
View File
@@ -1,25 +1,22 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment> <Fragment>
<ComponentGroup Id="MainComponents"> <ComponentGroup Id="MainComponents">
<Component Directory="INSTALLFOLDER"> <Component Directory="InstallFolder">
<File Source="$(var.BuildPath)\PamhagenSysCtrl.exe" <File Source="$(var.BuildPath)\PamhagenSysCtrl.exe" Id="PamhagenSysCtrl.exe"/>
Id="PamhagenSysCtrl.exe" />
</Component> </Component>
<Files Directory="InstallFolder" Include="$(var.BuildPath)\**">
<Component Directory="SourceFolder"> <Exclude Files="$(var.BuildPath)\PamhagenSysCtrl.exe"/>
<File Source="$(ProjectDir)\Files\PamhagenSysCtrl-source.zip" <Exclude Files="$(var.BuildPath)\**.pdb"/>
Id="PamhagenSysCtrlSource.zip" />
</Component>
<Component Directory="INSTALLFOLDER">
<File Source="$(ProjectDir)\Files\README.txt"
Id="README.txt" />
</Component>
<Files Directory="INSTALLFOLDER" Include="$(var.BuildPath)\**">
<Exclude Files="$(var.BuildPath)\PamhagenSysCtrl.exe" />
<Exclude Files="$(var.BuildPath)\**.pdb" />
</Files> </Files>
</ComponentGroup> <Component Directory="SourceFolder">
<File Source="$(ProjectDir)\Files\pamhagen-sysctrl.zip" Id="pamhagen_sysctrl.zip"/>
</Component>
<Component Directory="ConfigFolder" Permanent="true" NeverOverwrite="true">
<File Source="$(ProjectDir)\Files\config.ini" Id="config.ini"/>
</Component>
<Component Directory="ConfigFolder">
<File Source="$(ProjectDir)\Files\README.txt" Id="README.txt"/>
</Component>
</ComponentGroup>
</Fragment> </Fragment>
</Wix> </Wix>
+7 -8
View File
@@ -1,18 +1,17 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Pamhagen" <Package Name="Anlagensteuerung Pamhagen"
Manufacturer="Pamhagen" Manufacturer="Anlagensteuerung Pamhagen"
Version="$(var.ProductVersion)" Version="$(var.ProductVersion)"
Language="3079" Language="3079"
UpgradeCode="f214bfc6-1cd0-4971-807e-a4830e3b82a3" UpgradeCode="f214bfc6-1cd0-4971-807e-a4830e3b82a3"
Scope="perMachine" Scope="perMachine"
Compressed="true"> Compressed="true">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="no"/>
AllowSameVersionUpgrades="no" /> <MediaTemplate EmbedCab="true" CompressionLevel="high"/>
<MediaTemplate EmbedCab="true" CompressionLevel="high" />
<Feature Id="Main" Title="Pamhagen" Level="1"> <Feature Id="Main" Title="Anlagensteuerung Pamhagen" Level="1">
<ComponentGroupRef Id="MainComponents" /> <ComponentGroupRef Id="MainComponents"/>
<ComponentGroupRef Id="ShortcutComponents" /> <ComponentGroupRef Id="ShortcutComponents"/>
</Feature> </Feature>
</Package> </Package>
</Wix> </Wix>
+4 -4
View File
@@ -8,8 +8,8 @@
<Shortcut Id="ApplicationStartMenuShortcut" <Shortcut Id="ApplicationStartMenuShortcut"
Name="!(bind.Property.ProductName)" Name="!(bind.Property.ProductName)"
Description="!(bind.Property.ProductName)" Description="!(bind.Property.ProductName)"
Target="[INSTALLFOLDER]PamhagenSysCtrl.exe" Target="[InstallFolder]PamhagenSysCtrl.exe"
WorkingDirectory="INSTALLFOLDER" /> WorkingDirectory="InstallFolder" />
<RemoveFolder Id="StartMenuProgramsFolder" On="uninstall" /> <RemoveFolder Id="StartMenuProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" <RegistryValue Root="HKCU"
Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)" Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)"
@@ -25,8 +25,8 @@
<Shortcut Id="DesktopShortcut" <Shortcut Id="DesktopShortcut"
Name="!(bind.Property.ProductName)" Name="!(bind.Property.ProductName)"
Description="!(bind.Property.ProductName)" Description="!(bind.Property.ProductName)"
Target="[INSTALLFOLDER]PamhagenSysCtrl.exe" Target="[InstallFolder]PamhagenSysCtrl.exe"
WorkingDirectory="INSTALLFOLDER" /> WorkingDirectory="InstallFolder" />
<RegistryValue Root="HKCU" <RegistryValue Root="HKCU"
Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)" Key="Software\!(bind.Property.Manufacturer)\!(bind.Property.ProductName)"
Name="desktop_installed" Name="desktop_installed"
+2 -2
View File
@@ -3,8 +3,8 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework> <TargetFramework>net10.0-windows</TargetFramework>
<Version>1.0.0</Version> <Version>0.0.1</Version>
<Product>Pamhagen</Product> <Product>Anlagensteuerung Pamhagen</Product>
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages> <SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>